1 18 package org.apache.activemq.broker; 19 20 import java.io.IOException ; 21 import java.net.URISyntaxException ; 22 23 import org.apache.activemq.broker.BrokerService; 24 import org.apache.activemq.store.PersistenceAdapter; 25 26 public class BrokerRestartTestSupport extends BrokerTestSupport { 27 28 private PersistenceAdapter persistenceAdapter; 29 30 protected BrokerService createBroker() throws Exception { 31 BrokerService broker = new BrokerService(); 32 broker.setPersistent(false); 33 persistenceAdapter = broker.getPersistenceAdapter(); 34 return broker; 35 } 36 37 41 protected BrokerService createRestartedBroker() throws Exception { 42 BrokerService broker = new BrokerService(); 43 broker.setPersistenceAdapter(persistenceAdapter); 44 return broker; 45 } 46 47 54 protected void restartBroker() throws Exception { 55 broker.stop(); 56 broker = createRestartedBroker(); 57 broker.start(); 58 } 59 60 61 } 62 | Popular Tags |