diff options
Diffstat (limited to 'branches/sca-java-1.3/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java')
-rw-r--r-- | branches/sca-java-1.3/samples/helloworld-service-jms/src/main/java/helloworld/HelloWorldServer.java | 25 |
1 files changed, 18 insertions, 7 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");
}
}
|