[hornetq-commits] JBoss hornetq SVN: r11204 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Aug 13 13:22:41 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-08-13 13:22:40 -0400 (Sat, 13 Aug 2011)
New Revision: 11204

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
Log:
Improving testsuite

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java	2011-08-13 07:45:59 UTC (rev 11203)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java	2011-08-13 17:22:40 UTC (rev 11204)
@@ -34,8 +34,6 @@
 import org.hornetq.api.core.TransportConfiguration;
 import org.hornetq.api.core.client.ClientMessage;
 import org.hornetq.api.core.client.ClusterTopologyListener;
-import org.hornetq.api.core.client.HornetQClient;
-import org.hornetq.api.core.client.ServerLocator;
 import org.hornetq.api.core.management.ManagementHelper;
 import org.hornetq.api.core.management.NotificationType;
 import org.hornetq.core.client.impl.ServerLocatorImpl;
@@ -51,7 +49,6 @@
 import org.hornetq.core.server.Queue;
 import org.hornetq.core.server.cluster.Bridge;
 import org.hornetq.core.server.cluster.ClusterConnection;
-import org.hornetq.core.server.cluster.ClusterManager;
 import org.hornetq.core.server.cluster.MessageFlowRecord;
 import org.hornetq.core.server.cluster.RemoteQueueBinding;
 import org.hornetq.core.server.group.impl.Proposal;
@@ -662,6 +659,7 @@
                                 final boolean start) throws Exception
    {
       final Topology topology = new Topology(null);
+      topology.setExecutor(executorFactory.getExecutor());
       final ServerLocatorInternal targetLocator = new ServerLocatorImpl(topology, false, connector);
 
       targetLocator.setReconnectAttempts(0);
@@ -691,7 +689,8 @@
       targetLocator.disableFinalizeCheck();
 
       targetLocator.connect();
-      ClusterTopologyListener listenerOnBridgeTopology = new ClusterTopologyListener()
+      
+      final ClusterTopologyListener listenerOnBridgeTopology = new ClusterTopologyListener()
       {
 
          public void nodeDown(String nodeID)
@@ -708,7 +707,7 @@
 
       };
 
-      ClusterTopologyListener listenerOnMainTopology = new ClusterTopologyListener()
+      final ClusterTopologyListener listenerOnMainTopology = new ClusterTopologyListener()
       {
          public void nodeDown(String nodeID)
          {
@@ -729,7 +728,6 @@
 
       clusterManagerTopology.addClusterTopologyListener(listenerOnMainTopology);
 
-
       MessageFlowRecordImpl record = new MessageFlowRecordImpl(listenerOnMainTopology, listenerOnBridgeTopology, targetLocator, targetNodeID, connector, queueName, queue);
 
       topology.setOwner(record);
@@ -775,6 +773,14 @@
       if (start)
       {
          bridge.start();
+         
+         bridge.getExecutor().execute(new Runnable(){
+            public void run()
+            {
+               topology.sendTopology(listenerOnBridgeTopology);
+               clusterManagerTopology.sendTopology(listenerOnMainTopology);
+            }
+         });
       }
    }
 



More information about the hornetq-commits mailing list