summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/hello.jsp2
-rw-r--r--sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldServlet.java2
-rw-r--r--sca-java-2.x/trunk/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java14
-rw-r--r--sca-java-2.x/trunk/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java2
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java4
-rw-r--r--sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryImpl.java2
6 files changed, 17 insertions, 9 deletions
diff --git a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/hello.jsp b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/hello.jsp
index c5c3114693..45ae96cb82 100644
--- a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/hello.jsp
+++ b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/hello.jsp
@@ -23,7 +23,7 @@
<%@ page import="java.net.URI" %>
<%
- HelloworldService service = SCAClientFactory.newInstance(URI.create("tuscany:default")).getService(HelloworldService.class, "HelloworldComponent");
+ HelloworldService service = SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, "HelloworldComponent");
%>
<html>
diff --git a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldServlet.java b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldServlet.java
index 6124592a6d..5be51fab61 100644
--- a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldServlet.java
+++ b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldServlet.java
@@ -42,7 +42,7 @@ public class HelloworldServlet extends HttpServlet {
try {
String component = request.getParameter("component");
- HelloworldService service = SCAClientFactory.newInstance(URI.create("tuscany:default")).getService(HelloworldService.class, component);
+ HelloworldService service = SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, component);
String name = request.getParameter("name");
String greeting = service.sayHello(name);
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 {
diff --git a/sca-java-2.x/trunk/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java b/sca-java-2.x/trunk/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java
index a9f8da8f45..59fecbf8f7 100644
--- a/sca-java-2.x/trunk/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java
+++ b/sca-java-2.x/trunk/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java
@@ -195,7 +195,7 @@ public class Installer {
"\r\n\r\n <!-- The Tuscany SCA default domain URI.\r\n" +
" Individual contributions may used different domains by having their \r\n" +
" context.xml files overriding this parameter. -->\r\n" +
- " <Parameter name=\"org.apache.tuscany.sca.defaultDomainURI\" value=\"vm:default\"/>";
+ " <Parameter name=\"org.apache.tuscany.sca.defaultDomainURI\" value=\"default\"/>";
private void addTuscanyContextXml() {
File contextXmlFile = new File(catalinaBase, "/conf/context.xml");
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
index 8ee7d5bdbf..98f6b5a481 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
@@ -85,14 +85,14 @@ public class DomainNode {
if (nodes.containsKey(uri)) {
throw new IllegalArgumentException("contribution already added: " + uri);
}
- NodeConfiguration configuration = NodeFactory.newInstance().createNodeConfiguration();
+ NodeConfiguration configuration = NodeFactory.getInstance().createNodeConfiguration();
if (location != null) {
configuration.addContribution(uri, location);
}
configuration.setDomainRegistryURI(domainRegistryURI);
configuration.setDomainURI(domainName);
configuration.setURI(uri); //???
- Node node = NodeFactory.newInstance().createNode(configuration).start();
+ Node node = NodeFactory.getInstance().createNode(configuration).start();
nodes.put(uri, node);
}
diff --git a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryImpl.java b/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryImpl.java
index b170c30045..7dad6a28db 100644
--- a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryImpl.java
+++ b/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryImpl.java
@@ -48,7 +48,7 @@ public class SCAClientFactoryImpl extends SCAClientFactory {
public SCAClientFactoryImpl(URI domainURI) throws NoSuchDomainException {
super(domainURI);
- NodeImpl node = (NodeImpl)NodeFactory.newInstance().createNode(domainURI);
+ NodeImpl node = (NodeImpl)NodeFactory.getInstance().createNode(domainURI);
if (node.getExtensionPoints() == null) {
// No local nodes have been started (for this domain?)
// ideally we'll use the Hazelcast client but for now just start a node