diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-25 14:29:05 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-25 14:29:05 +0000 |
commit | a0d5ac96505179eee741af4f819761fe28a3868a (patch) | |
tree | b86e29bb65d9d1da3207cd05117e5ad3dc73d76b /sca-java-2.x/trunk/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany | |
parent | 8e8afc95b38a5d09926b2be1f0351e0d90f7b4b5 (diff) |
Catch up the tomcat runtime with all the recent domain and node changes
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@902818 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany')
-rw-r--r-- | sca-java-2.x/trunk/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java b/sca-java-2.x/trunk/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java index dc6ae2b601..8b7af4c268 100644 --- a/sca-java-2.x/trunk/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java +++ b/sca-java-2.x/trunk/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java @@ -21,6 +21,8 @@ package org.apache.tuscany.sca.tomcat; import java.io.File; import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.net.URI; import java.net.URL; import java.net.URLClassLoader; import java.util.logging.Logger; @@ -158,9 +160,15 @@ public class TuscanyStandardContext extends StandardContext { ClassLoader oldCL = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(tuscanyClassLoader); - Class<?> domainNodeClass = Class.forName("org.apache.tuscany.sca.domain.node.DomainNode", true, tuscanyClassLoader); - Constructor<?> domainNodeConstructor = domainNodeClass.getConstructor(new Class[] {String.class, new String[0].getClass()}); - domainNodeConstructor.newInstance(TuscanyLifecycleListener.getDomainURI(), new String[0]); + Class<?> nodeFactoryClass = Class.forName("org.apache.tuscany.sca.node.NodeFactory", true, tuscanyClassLoader); + Method getInstanceMethod = nodeFactoryClass.getMethod("getInstance", new Class[0]); + Object instance = getInstanceMethod.invoke(null); + Method createNodeMethod = nodeFactoryClass.getMethod("createNode", new Class[]{URI.class, new String[0].getClass()}); + URI domainURI = URI.create(TuscanyLifecycleListener.getDomainURI()); + Object node = createNodeMethod.invoke(instance, new Object[]{domainURI, new String[0]}); + Class<?> nodeClass = Class.forName("org.apache.tuscany.sca.node.Node", true, tuscanyClassLoader); + Method nodeStartMethod = nodeClass.getMethod("start", new Class[0]); + nodeStartMethod.invoke(node); } catch (Exception e) { throw new RuntimeException(e); } finally { |