01: package org.objectweb.celtix.systest.jms;
02:
03: import org.activemq.broker.BrokerContainer;
04: import org.activemq.broker.impl.BrokerContainerImpl;
05: import org.activemq.store.vm.VMPersistenceAdapter;
06:
07: import org.objectweb.celtix.systest.common.TestServerBase;
08:
09: public class EmbeddedJMSBrokerLauncher extends TestServerBase {
10:
11: BrokerContainer container;
12: final String brokerUrl1 = "tcp://localhost:61500";
13:
14: public void tearDown() throws Exception {
15: if (container != null) {
16: container.stop();
17: }
18: }
19:
20: public void run() {
21: try {
22: container = new BrokerContainerImpl();
23: container.addConnector(brokerUrl1);
24: container.setPersistenceAdapter(new VMPersistenceAdapter());
25: container.start();
26: } catch (Exception e) {
27: e.printStackTrace();
28: }
29: }
30:
31: public static void main(String[] args) {
32: try {
33: EmbeddedJMSBrokerLauncher s = new EmbeddedJMSBrokerLauncher();
34: s.start();
35: } catch (Exception ex) {
36: ex.printStackTrace();
37: System.exit(-1);
38: } finally {
39: System.out.println("done!");
40: }
41: }
42: }
|