From f4fe8ce437b8ba7ba45882d3dda8facc7c9bef0f Mon Sep 17 00:00:00 2001 From: rfeng Date: Wed, 30 Jul 2008 20:37:07 +0000 Subject: Switch to SCANode2 API git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@681196 13f79535-47bb-0310-9956-ffa450edef68 --- java/sca/modules/domain-manager/pom.xml | 10 +++++++++- .../manager/launcher/DomainManagerLauncherBootstrap.java | 13 ++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'java/sca/modules/domain-manager') 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 @@ org.apache.tuscany.sca - tuscany-host-embedded + tuscany-node2-api 1.4-SNAPSHOT + + + org.apache.tuscany.sca + tuscany-node2-impl + 1.4-SNAPSHOT + runtime + + org.apache.tuscany.sca 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); } -- cgit v1.2.3