in stop() remove VMTransports after services stopped - to avoid a timing issue with

discovery spinning up a new instance

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@491794 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-01-02 13:39:10 +00:00
parent 4cd0a27f91
commit 81c5b1500b
1 changed files with 7 additions and 3 deletions

View File

@ -395,6 +395,7 @@ public class BrokerService implements Service, Serializable {
addShutdownHook();
log.info("Using Persistence Adapter: " + getPersistenceAdapter());
if (deleteAllMessagesOnStartup) {
deleteAllMessages();
}
@ -448,8 +449,7 @@ public class BrokerService implements Service, Serializable {
stopAllConnectors(stopper);
//remove any VMTransports connected
VMTransportFactory.stopped(getBrokerName());
stopper.stop(persistenceAdapter);
@ -476,7 +476,10 @@ public class BrokerService implements Service, Serializable {
}
stopper.stop(getManagementContext());
}
//remove any VMTransports connected
//this has to be done after services are stopped,
//to avoid timimg issue with discovery (spinning up a new instance)
VMTransportFactory.stopped(getBrokerName());
log.info("ActiveMQ JMS Message Broker (" + getBrokerName()+", "+brokerId+") stopped");
stopper.throwFirstException();
@ -1513,6 +1516,7 @@ public class BrokerService implements Service, Serializable {
for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) {
NetworkConnector connector = (NetworkConnector) iter.next();
connector.setLocalUri(getVmConnectorURI());
connector.setBrokerName(getBrokerName());
connector.setDurableDestinations(getBroker().getDurableDestinations());
connector.start();