summaryrefslogtreecommitdiffstats
path: root/branches/sca-equinox/modules/domain-manager/src/main
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-10-09 06:33:54 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-10-09 06:33:54 +0000
commitefe3363a815a777ecd283928900404dea84a7e1f (patch)
tree42522fd01e6af981f8ff94663d911d56744154d5 /branches/sca-equinox/modules/domain-manager/src/main
parentaacabe1650e380595a8d701123394d791656d17d (diff)
Work in progress. Fixed implementation of NodeImpl, now working without dependencies on implementations from other bundles (except RuntimeAssemblyFactory, which will need to be cleaned up too). Started to remove dependencies on host-embedded and port code to NodeFactory and Node, as an interim step to bring them up, before porting them to the OSGi-enabled node launcher.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@703068 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-equinox/modules/domain-manager/src/main')
-rw-r--r--branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java46
1 files changed, 36 insertions, 10 deletions
diff --git a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java
index f96e19ed72..87fd41a74f 100644
--- a/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java
+++ b/branches/sca-equinox/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java
@@ -20,9 +20,12 @@
package org.apache.tuscany.sca.domain.manager.launcher;
import org.apache.tuscany.sca.domain.manager.impl.DomainManagerConfiguration;
-import org.apache.tuscany.sca.node.SCAClient;
-import org.apache.tuscany.sca.node.SCANode;
-import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ServiceReference;
/**
* Bootstrap class for the SCA domain manager.
@@ -30,15 +33,15 @@ import org.apache.tuscany.sca.node.SCANodeFactory;
* @version $Rev$ $Date$
*/
public class DomainManagerLauncherBootstrap {
- private SCANode node;
+ private Node node;
/**
* A node wrappering an instance of a domain manager.
*/
- public static class NodeFacade implements SCANode {
+ public static class NodeFacade implements Node {
private ClassLoader threadContextClassLoader;
private ClassLoader runtimeClassLoader;
- private SCANode node;
+ private Node node;
private String rootDirectory;
private NodeFacade(String rootDirectory) {
@@ -51,12 +54,13 @@ public class DomainManagerLauncherBootstrap {
boolean started = false;
try {
Thread.currentThread().setContextClassLoader(runtimeClassLoader);
- SCANodeFactory factory = SCANodeFactory.newInstance();
- node = factory.createSCANodeFromClassLoader("DomainManager.composite", getClass().getClassLoader());
+ NodeFactory factory = NodeFactory.newInstance();
+ String contribution = ContributionLocationHelper.getContributionLocation(getClass());
+ node = factory.createNode("DomainManager.composite", new Contribution("domain-manager", contribution));
node.start();
// Set the domain manager's root directory
- DomainManagerConfiguration domainManagerConfiguration = ((SCAClient) node).getService(DomainManagerConfiguration.class, "DomainManagerConfigurationComponent");
+ DomainManagerConfiguration domainManagerConfiguration = node.getService(DomainManagerConfiguration.class, "DomainManagerConfigurationComponent");
domainManagerConfiguration.setRootDirectory(rootDirectory);
started = true;
@@ -75,6 +79,28 @@ public class DomainManagerLauncherBootstrap {
Thread.currentThread().setContextClassLoader(threadContextClassLoader);
}
}
+
+ public void destroy() {
+ try {
+ Thread.currentThread().setContextClassLoader(runtimeClassLoader);
+ node.destroy();
+ } finally {
+ Thread.currentThread().setContextClassLoader(threadContextClassLoader);
+ }
+ }
+
+ public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
+ throw new UnsupportedOperationException();
+ }
+
+ public <B> B getService(Class<B> businessInterface, String serviceName) {
+ throw new UnsupportedOperationException();
+ }
+
+ public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String serviceName) {
+ throw new UnsupportedOperationException();
+ }
+
}
/**
@@ -88,7 +114,7 @@ public class DomainManagerLauncherBootstrap {
* Returns the node representing the domain manager.
* @return
*/
- public SCANode getNode() {
+ public Node getNode() {
return node;
}