refactored out a protected stopAllConnectors() so it can be overriden in derived classes.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@466320 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-10-21 01:57:35 +00:00
parent 29459ed414
commit 319966c129
1 changed files with 25 additions and 20 deletions

View File

@ -432,26 +432,7 @@ public class BrokerService implements Service, Serializable {
}
}
for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) {
NetworkConnector connector = (NetworkConnector) iter.next();
unregisterNetworkConnectorMBean(connector);
stopper.stop(connector);
}
for (Iterator iter = getProxyConnectors().iterator(); iter.hasNext();) {
ProxyConnector connector = (ProxyConnector) iter.next();
stopper.stop(connector);
}
for (Iterator iter = jmsConnectors.iterator(); iter.hasNext();) {
JmsConnector connector = (JmsConnector) iter.next();
stopper.stop(connector);
}
for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) {
TransportConnector connector = (TransportConnector) iter.next();
stopper.stop(connector);
}
stopAllConnectors(stopper);
//remove any VMTransports connected
@ -488,6 +469,30 @@ public class BrokerService implements Service, Serializable {
stopper.throwFirstException();
}
protected void stopAllConnectors(ServiceStopper stopper) {
for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) {
NetworkConnector connector = (NetworkConnector) iter.next();
unregisterNetworkConnectorMBean(connector);
stopper.stop(connector);
}
for (Iterator iter = getProxyConnectors().iterator(); iter.hasNext();) {
ProxyConnector connector = (ProxyConnector) iter.next();
stopper.stop(connector);
}
for (Iterator iter = jmsConnectors.iterator(); iter.hasNext();) {
JmsConnector connector = (JmsConnector) iter.next();
stopper.stop(connector);
}
for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) {
TransportConnector connector = (TransportConnector) iter.next();
stopper.stop(connector);
}
}
// Properties
// -------------------------------------------------------------------------