From 635e6e744540cc4b20686781086d41dce7198b5f Mon Sep 17 00:00:00 2001 From: "Adrian T. Co" Date: Fri, 17 Mar 2006 10:38:02 +0000 Subject: [PATCH] - Perform the actual setup of the connectors when it is actually started. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@386603 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/broker/BrokerService.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 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 853462c734..04b64611bb 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 @@ -154,18 +154,6 @@ public class BrokerService implements Service { */ public TransportConnector addConnector(TransportConnector connector) throws Exception { - connector.setBroker(getBroker()); - connector.setBrokerName(getBrokerName()); - connector.setTaskRunnerFactory(getTaskRunnerFactory()); - MessageAuthorizationPolicy policy = getMessageAuthorizationPolicy(); - if (policy != null) { - connector.setMessageAuthorizationPolicy(policy); - } - - if (isUseJmx()) { - connector = connector.asManagedConnector(getManagementContext().getMBeanServer(), getBrokerObjectName()); - registerConnectorMBean(connector); - } transportConnectors.add(connector); return connector; @@ -1056,7 +1044,7 @@ public class BrokerService implements Service { if (!isSlave()){ for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) { TransportConnector connector = (TransportConnector) iter.next(); - connector.start(); + startTransportConnector(connector); } for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) { @@ -1078,6 +1066,22 @@ public class BrokerService implements Service { } } + protected void startTransportConnector(TransportConnector connector) throws Exception { + connector.setBroker(getBroker()); + connector.setBrokerName(getBrokerName()); + connector.setTaskRunnerFactory(getTaskRunnerFactory()); + MessageAuthorizationPolicy policy = getMessageAuthorizationPolicy(); + if (policy != null) { + connector.setMessageAuthorizationPolicy(policy); + } + + if (isUseJmx()) { + connector = connector.asManagedConnector(getManagementContext().getMBeanServer(), getBrokerObjectName()); + registerConnectorMBean(connector); + } + connector.start(); + } + public boolean isDeleteAllMessagesOnStartup() { return deleteAllMessagesOnStartup; }