diff options
Diffstat (limited to 'sca-java-2.x/trunk/distribution/tomcat')
-rw-r--r-- | sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml | 5 | ||||
-rw-r--r-- | sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testingxxx/HelloworldClient.java (renamed from sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldClient.java) | 11 | ||||
-rw-r--r-- | sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testingxxx/HelloworldService.java (renamed from sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldService.java) | 2 | ||||
-rw-r--r-- | sca-java-2.x/trunk/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java | 25 | ||||
-rw-r--r-- | sca-java-2.x/trunk/distribution/tomcat/tomcat-war/src/main/webapp/LICENSE | 1 |
5 files changed, 35 insertions, 9 deletions
diff --git a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml index 39c6bb2b59..fcc7189d2d 100644 --- a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml +++ b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/pom.xml @@ -35,6 +35,11 @@ <artifactId>tuscany-base-nodep</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca.shades</groupId>
+ <artifactId>tuscany-bpel</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
diff --git a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldClient.java b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testingxxx/HelloworldClient.java index b36fe418a4..442d050454 100644 --- a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldClient.java +++ b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testingxxx/HelloworldClient.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations
* under the License.
*/
-package testing;
+package testingxxx;
import java.net.URI;
@@ -24,6 +24,8 @@ import org.oasisopen.sca.NoSuchDomainException; import org.oasisopen.sca.NoSuchServiceException;
import org.oasisopen.sca.client.SCAClientFactory;
+import com.hazelcast.client.InRunnable;
+
public class HelloworldClient {
@@ -33,11 +35,14 @@ public class HelloworldClient { if (args.length > 0) {
domainURI = URI.create(args[0]);
} else {
- domainURI = URI.create("tuscany:default?remotes=192.168.1.73:14820");
+ domainURI = URI.create("tuscanyclient:foo?remotes=127.0.0.1:14820");
}
+ InRunnable xx;
SCAClientFactory factory = SCAClientFactory.newInstance(domainURI);
HelloworldService service = factory.getService(HelloworldService.class, "HelloworldComponent");
- System.out.println(service.sayHello("world"));
+ System.out.println(service.sayHello("world"));
+ System.out.println(service.sayHello("world2"));
+ System.out.println(service.sayHello("world3"));
}
}
diff --git a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldService.java b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testingxxx/HelloworldService.java index b035a772be..81ce1ec739 100644 --- a/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testing/HelloworldService.java +++ b/sca-java-2.x/trunk/distribution/tomcat/testing/helloworld-scaclient-javase/src/main/java/testingxxx/HelloworldService.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations
* under the License.
*/
-package testing;
+package testingxxx;
import org.oasisopen.sca.annotation.Remotable;
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 8b7af4c268..ca9c81f1c3 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 @@ -20,7 +20,6 @@ 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; @@ -31,6 +30,7 @@ import javax.naming.NameClassPair; import javax.naming.NamingEnumeration; import javax.naming.NamingException; +import org.apache.catalina.LifecycleException; import org.apache.catalina.Loader; import org.apache.catalina.core.StandardContext; @@ -49,6 +49,9 @@ public class TuscanyStandardContext extends StandardContext { // TODO: this gives an instance per webapp, work out how to have only one per server // ?? is that comment still true? private static URLClassLoader tuscanyClassLoader; + private static Object node; + private static Class<?> nodeClass; + private static Method nodeStopMethod; public TuscanyStandardContext() { } @@ -165,9 +168,10 @@ public class TuscanyStandardContext extends StandardContext { 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); + this.node = createNodeMethod.invoke(instance, new Object[]{domainURI, new String[0]}); + this.nodeClass = Class.forName("org.apache.tuscany.sca.node.Node", true, tuscanyClassLoader); Method nodeStartMethod = nodeClass.getMethod("start", new Class[0]); + this.nodeStopMethod = nodeClass.getMethod("stop", new Class[0]); nodeStartMethod.invoke(node); } catch (Exception e) { throw new RuntimeException(e); @@ -175,5 +179,18 @@ public class TuscanyStandardContext extends StandardContext { Thread.currentThread().setContextClassLoader(oldCL); } } - + + @Override + public synchronized void stop() throws LifecycleException { + super.stop(); + + if (node != null && nodeStopMethod != null) { + try { + nodeStopMethod.invoke(node); + node = null; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } } diff --git a/sca-java-2.x/trunk/distribution/tomcat/tomcat-war/src/main/webapp/LICENSE b/sca-java-2.x/trunk/distribution/tomcat/tomcat-war/src/main/webapp/LICENSE index c3a48c860f..2aa6af9c47 100644 --- a/sca-java-2.x/trunk/distribution/tomcat/tomcat-war/src/main/webapp/LICENSE +++ b/sca-java-2.x/trunk/distribution/tomcat/tomcat-war/src/main/webapp/LICENSE @@ -237,7 +237,6 @@ The following components come under Apache Software License 2.0 commons-fileupload-1.2.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
- commons-logging-1.1.1.jar
geronimo-activation_1.1_spec-1.0.1.jar
geronimo-javamail_1.4_spec-1.6.jar
geronimo-jms_1.1_spec-1.1.jar
|