From 8610db3e14758db6f55a19ec0f4f25eeff10b6f7 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Sun, 19 Feb 2006 22:12:39 +0000 Subject: [PATCH] remove VMTransport connectors last in stop() - can prevent hanging tests git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@378966 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/broker/BrokerService.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java index 4d8e450bc7..0dced0294d 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -356,9 +356,7 @@ public class BrokerService implements Service { } log.info("ActiveMQ Message Broker (" + getBrokerName() + ") is shutting down"); BrokerRegistry.getInstance().unbind(getBrokerName()); - //remove any VMTransports connected - VMTransportFactory.stopped(getBrokerName()); - + removeShutdownHook(); ServiceStopper stopper = new ServiceStopper(); @@ -366,12 +364,7 @@ public class BrokerService implements Service { masterConnector.stop(); } - for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) { - - TransportConnector connector = (TransportConnector) iter.next(); - stopper.stop(connector); - } - + for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) { NetworkConnector connector = (NetworkConnector) iter.next(); stopper.stop(connector); @@ -386,6 +379,16 @@ public class BrokerService implements Service { JmsConnector connector = (JmsConnector) iter.next(); stopper.stop(connector); } + for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) { + + TransportConnector connector = (TransportConnector) iter.next(); + stopper.stop(connector); + } + + + //remove any VMTransports connected + VMTransportFactory.stopped(getBrokerName()); + stopper.stop(getPersistenceAdapter());