git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/branches/activemq-4.1@477571 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonas B. Lim 2006-11-21 08:15:44 +00:00
parent f4a7b26f28
commit 2eba7ef00a
1 changed files with 13 additions and 2 deletions

View File

@ -1463,10 +1463,19 @@ public class BrokerService implements Service, Serializable {
*/ */
protected void startAllConnectors() throws Exception{ protected void startAllConnectors() throws Exception{
if (!isSlave()){ if (!isSlave()){
ArrayList al = new ArrayList();
for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) { for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) {
TransportConnector connector = (TransportConnector) iter.next(); TransportConnector connector = (TransportConnector) iter.next();
startTransportConnector(connector); al.add(startTransportConnector(connector));
} }
if (al.size()>0) {
//let's clear the transportConnectors list and replace it with the started transportConnector instances
this.transportConnectors.clear();
setTransportConnectors(al);
}
for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) { for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) {
NetworkConnector connector = (NetworkConnector) iter.next(); NetworkConnector connector = (NetworkConnector) iter.next();
@ -1495,7 +1504,7 @@ public class BrokerService implements Service, Serializable {
} }
} }
protected void startTransportConnector(TransportConnector connector) throws Exception { protected TransportConnector startTransportConnector(TransportConnector connector) throws Exception {
connector.setBroker(getBroker()); connector.setBroker(getBroker());
connector.setBrokerName(getBrokerName()); connector.setBrokerName(getBrokerName());
connector.setTaskRunnerFactory(getTaskRunnerFactory()); connector.setTaskRunnerFactory(getTaskRunnerFactory());
@ -1508,6 +1517,8 @@ public class BrokerService implements Service, Serializable {
connector = registerConnectorMBean(connector); connector = registerConnectorMBean(connector);
} }
connector.start(); connector.start();
return connector;
} }
/** /**