diff options
-rw-r--r-- | java/sca/modules/domain-manager/pom.xml | 10 | ||||
-rw-r--r-- | java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java | 13 |
2 files changed, 17 insertions, 6 deletions
diff --git a/java/sca/modules/domain-manager/pom.xml b/java/sca/modules/domain-manager/pom.xml index 52fb5d5796..af6d35fa40 100644 --- a/java/sca/modules/domain-manager/pom.xml +++ b/java/sca/modules/domain-manager/pom.xml @@ -67,9 +67,17 @@ <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-host-embedded</artifactId> + <artifactId>tuscany-node2-api</artifactId> <version>1.4-SNAPSHOT</version> </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node2-impl</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + <dependency> <groupId>org.apache.tuscany.sca</groupId> diff --git a/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java b/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java index 379f8b81cb..3e78073264 100644 --- a/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java +++ b/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/launcher/DomainManagerLauncherBootstrap.java @@ -20,8 +20,9 @@ package org.apache.tuscany.sca.domain.manager.launcher; import org.apache.tuscany.sca.domain.manager.impl.DomainManagerConfiguration; -import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.apache.tuscany.sca.node.SCAClient; import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; /** * Bootstrap class for the SCA domain manager. @@ -37,7 +38,7 @@ public class DomainManagerLauncherBootstrap { public static class NodeFacade implements SCANode2 { private ClassLoader threadContextClassLoader; private ClassLoader runtimeClassLoader; - private SCADomain domainManager; + private SCANode2 node; private String rootDirectory; private NodeFacade(String rootDirectory) { @@ -50,10 +51,12 @@ public class DomainManagerLauncherBootstrap { boolean started = false; try { Thread.currentThread().setContextClassLoader(runtimeClassLoader); - domainManager = SCADomain.newInstance("DomainManager.composite"); + SCANode2Factory factory = SCANode2Factory.newInstance(); + node = factory.createSCANodeFromClassLoader("DomainManager.composite", getClass().getClassLoader()); + node.start(); // Set the domain manager's root directory - DomainManagerConfiguration domainManagerConfiguration = domainManager.getService(DomainManagerConfiguration.class, "DomainManagerConfigurationComponent"); + DomainManagerConfiguration domainManagerConfiguration = ((SCAClient) node).getService(DomainManagerConfiguration.class, "DomainManagerConfigurationComponent"); domainManagerConfiguration.setRootDirectory(rootDirectory); started = true; @@ -67,7 +70,7 @@ public class DomainManagerLauncherBootstrap { public void stop() { try { Thread.currentThread().setContextClassLoader(runtimeClassLoader); - domainManager.close(); + node.stop(); } finally { Thread.currentThread().setContextClassLoader(threadContextClassLoader); } |