summaryrefslogtreecommitdiffstats
path: root/java/sca/samples/helloworld-service-jms
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2008-07-25 09:01:03 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2008-07-25 09:01:03 +0000
commitdd66b9620ee7ab47ca93f90a54cbd5d1ace5f6dd (patch)
tree56dc307dce9a556b6f80e12e458670767a288dc1 /java/sca/samples/helloworld-service-jms
parent195df9a79d1bf7f7ef8d52e1d81f311bc42b0f1d (diff)
TUSCANY-2420 commit changes from 1.3 branch
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@679715 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/samples/helloworld-service-jms')
-rw-r--r--java/sca/samples/helloworld-service-jms/pom.xml10
-rw-r--r--java/sca/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java25
-rw-r--r--java/sca/samples/helloworld-service-jms/src/main/resources/helloworldjmsservice.composite2
3 files changed, 20 insertions, 17 deletions
diff --git a/java/sca/samples/helloworld-service-jms/pom.xml b/java/sca/samples/helloworld-service-jms/pom.xml
index c746230466..87c981b5c5 100644
--- a/java/sca/samples/helloworld-service-jms/pom.xml
+++ b/java/sca/samples/helloworld-service-jms/pom.xml
@@ -35,14 +35,7 @@
</repository>
</repositories>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
+ <dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-embedded</artifactId>
@@ -75,7 +68,6 @@
<groupId>org.apache.activemq</groupId>
<artifactId>apache-activemq</artifactId>
<version>4.1.1</version>
- <scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.activemq</groupId>
diff --git a/java/sca/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java b/java/sca/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java
index 12b2ab09c5..d4ea391a00 100644
--- a/java/sca/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java
+++ b/java/sca/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java
@@ -20,6 +20,7 @@ package helloworld;
import java.io.IOException;
+import org.apache.activemq.broker.BrokerService;
import org.apache.tuscany.sca.host.embedded.SCADomain;
/**
@@ -29,19 +30,29 @@ import org.apache.tuscany.sca.host.embedded.SCADomain;
public class HelloWorldServer {
public static void main(String[] args) {
-
- // ActiveMQModuleActivator.startBroker();
- SCADomain scaDomain = SCADomain.newInstance("helloworldjmsservice.composite");
-
try {
+ BrokerService jmsBroker;
+ jmsBroker = new BrokerService();
+ jmsBroker.setPersistent(false);
+ jmsBroker.setUseJmx(false);
+ jmsBroker.addConnector("tcp://localhost:61619");
+ jmsBroker.start();
+
+ SCADomain scaDomain = SCADomain.newInstance("helloworldjmsservice.composite");
+
System.out.println("HelloWorld server started (press enter to shutdown)");
System.in.read();
+
+ scaDomain.close();
+
+ jmsBroker.stop();
+ System.out.println("HelloWorld server stopped");
+
} catch (IOException e) {
e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
}
-
- scaDomain.close();
- System.out.println("HelloWorld server stopped");
}
}
diff --git a/java/sca/samples/helloworld-service-jms/src/main/resources/helloworldjmsservice.composite b/java/sca/samples/helloworld-service-jms/src/main/resources/helloworldjmsservice.composite
index 4565a50f65..3135cdc320 100644
--- a/java/sca/samples/helloworld-service-jms/src/main/resources/helloworldjmsservice.composite
+++ b/java/sca/samples/helloworld-service-jms/src/main/resources/helloworldjmsservice.composite
@@ -21,7 +21,7 @@
xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://helloworld"
xmlns:hw="http://helloworld"
- name="helloworldws">
+ name="helloworld">
<component name="HelloWorldServiceComponent">
<implementation.java class="helloworld.HelloWorldImpl" />