1 package org.objectweb.celtix.systest.jms; 2 3 import org.activemq.broker.BrokerContainer; 4 import org.activemq.broker.impl.BrokerContainerImpl; 5 import org.activemq.store.vm.VMPersistenceAdapter; 6 7 import org.objectweb.celtix.systest.common.TestServerBase; 8 9 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 } 43 | Popular Tags |