summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.3/samples/helloworld-service-jms/src
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sca-java-1.3/samples/helloworld-service-jms/src')
-rw-r--r--branches/sca-java-1.3/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java25
-rw-r--r--branches/sca-java-1.3/samples/helloworld-service-jms/src/main/resources/helloworldjmsservice.composite2
2 files changed, 19 insertions, 8 deletions
diff --git a/branches/sca-java-1.3/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java b/branches/sca-java-1.3/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java
index 12b2ab09c5..d4ea391a00 100644
--- a/branches/sca-java-1.3/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java
+++ b/branches/sca-java-1.3/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/branches/sca-java-1.3/samples/helloworld-service-jms/src/main/resources/helloworldjmsservice.composite b/branches/sca-java-1.3/samples/helloworld-service-jms/src/main/resources/helloworldjmsservice.composite
index 4565a50f65..3135cdc320 100644
--- a/branches/sca-java-1.3/samples/helloworld-service-jms/src/main/resources/helloworldjmsservice.composite
+++ b/branches/sca-java-1.3/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" />