You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2007/01/02 18:13:54 UTC
svn commit: r491856 -
/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Author: rajdavies
Date: Tue Jan 2 09:13:54 2007
New Revision: 491856
URL: http://svn.apache.org/viewvc?view=rev&rev=491856
Log:
in stop() remove VMTransports after services stopped - to avoid a timing issue with
discovery spinning up a new instance
Modified:
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?view=diff&rev=491856&r1=491855&r2=491856
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java Tue Jan 2 09:13:54 2007
@@ -395,7 +395,6 @@
addShutdownHook();
log.info("Using Persistence Adapter: " + getPersistenceAdapter());
-
if (deleteAllMessagesOnStartup) {
deleteAllMessages();
}
@@ -428,60 +427,47 @@
}
- public void stop() throws Exception {
- if (! started.compareAndSet(true, false)) {
+ public void stop() throws Exception{
+ if(!started.compareAndSet(true,false)){
return;
}
- log.info("ActiveMQ Message Broker (" + getBrokerName()+", "+brokerId+") is shutting down");
- BrokerRegistry.getInstance().unbind(getBrokerName());
-
+ log.info("ActiveMQ Message Broker ("+getBrokerName()+", "+brokerId+") is shutting down");
removeShutdownHook();
-
- ServiceStopper stopper = new ServiceStopper();
-
- if (services != null) {
- for (int i = 0; i < services.length; i++) {
- Service service = services[i];
+ ServiceStopper stopper=new ServiceStopper();
+ if(services!=null){
+ for(int i=0;i<services.length;i++){
+ Service service=services[i];
stopper.stop(service);
}
}
-
stopAllConnectors(stopper);
-
-
-
-
-
stopper.stop(persistenceAdapter);
-
- if (broker != null) {
+ if(broker!=null){
stopper.stop(broker);
}
if(tempDataStore!=null){
tempDataStore.close();
}
-
- if (isUseJmx()) {
- MBeanServer mbeanServer = getManagementContext().getMBeanServer();
- if (mbeanServer != null) {
- for (Iterator iter = registeredMBeanNames.iterator(); iter.hasNext();) {
- ObjectName name = (ObjectName) iter.next();
- try {
+ if(isUseJmx()){
+ MBeanServer mbeanServer=getManagementContext().getMBeanServer();
+ if(mbeanServer!=null){
+ for(Iterator iter=registeredMBeanNames.iterator();iter.hasNext();){
+ ObjectName name=(ObjectName)iter.next();
+ try{
mbeanServer.unregisterMBean(name);
- }
- catch (Exception e) {
- stopper.onException(mbeanServer, e);
+ }catch(Exception e){
+ stopper.onException(mbeanServer,e);
}
}
}
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)
+ // remove any VMTransports connected
+ // this has to be done after services are stopped,
+ // to avoid timimg issue with discovery (spinning up a new instance)
+ BrokerRegistry.getInstance().unbind(getBrokerName());
VMTransportFactory.stopped(getBrokerName());
- log.info("ActiveMQ JMS Message Broker (" + getBrokerName()+", "+brokerId+") stopped");
-
+ log.info("ActiveMQ JMS Message Broker ("+getBrokerName()+", "+brokerId+") stopped");
stopper.throwFirstException();
}