activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r478063 - /incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Date Wed, 22 Nov 2006 07:42:40 GMT
Author: jlim
Date: Tue Nov 21 23:42:39 2006
New Revision: 478063

URL: http://svn.apache.org/viewvc?view=rev&rev=478063
Log:
applied patch for http://issues.apache.org/activemq/browse/AMQ-1029

Modified:
    incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java

Modified: incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?view=diff&rev=478063&r1=478062&r2=478063
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
(original)
+++ incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Tue Nov 21 23:42:39 2006
@@ -1071,10 +1071,19 @@
      */
     protected void startAllConnectors() throws Exception{
         if (!isSlave()){
+             
+            ArrayList al = new ArrayList();	
+        	
             for (Iterator iter = getTransportConnectors().iterator(); iter.hasNext();) {
                 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();) {
                 NetworkConnector connector = (NetworkConnector) iter.next();
@@ -1095,7 +1104,7 @@
         }
     }
 
-    protected void startTransportConnector(TransportConnector connector) throws Exception
{
+    protected TransportConnector startTransportConnector(TransportConnector connector) throws
Exception {
         connector.setBroker(getBroker());
         connector.setBrokerName(getBrokerName());
         connector.setTaskRunnerFactory(getTaskRunnerFactory());
@@ -1117,6 +1126,8 @@
             registerConnectorMBean(connector, objectName);
         }        
         connector.start();
+        
+        return connector;
     }
 
     public boolean isDeleteAllMessagesOnStartup() {



Mime
View raw message