[hornetq-commits] JBoss hornetq SVN: r10803 - in branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core: server/cluster/impl and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Jun 14 21:22:17 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-06-14 21:22:16 -0400 (Tue, 14 Jun 2011)
New Revision: 10803

Modified:
   branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/management/impl/BridgeControlImpl.java
   branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
   branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
Log:
Fixing tests

Modified: branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/management/impl/BridgeControlImpl.java
===================================================================
--- branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/management/impl/BridgeControlImpl.java	2011-06-14 15:05:40 UTC (rev 10802)
+++ branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/management/impl/BridgeControlImpl.java	2011-06-15 01:22:16 UTC (rev 10803)
@@ -241,6 +241,7 @@
       try
       {
          bridge.stop();
+         bridge.flushExecutor();
       }
       finally
       {

Modified: branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java	2011-06-14 15:05:40 UTC (rev 10802)
+++ branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java	2011-06-15 01:22:16 UTC (rev 10803)
@@ -23,10 +23,10 @@
 import org.hornetq.api.core.Message;
 import org.hornetq.api.core.SimpleString;
 import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession.BindingQuery;
 import org.hornetq.api.core.client.ClientSessionFactory;
 import org.hornetq.api.core.client.SendAcknowledgementHandler;
 import org.hornetq.api.core.client.SessionFailureListener;
-import org.hornetq.api.core.client.ClientSession.BindingQuery;
 import org.hornetq.api.core.management.NotificationType;
 import org.hornetq.core.client.impl.ClientSessionInternal;
 import org.hornetq.core.client.impl.ServerLocatorInternal;
@@ -242,35 +242,8 @@
 
    public void stop() throws Exception
    {
+      log.debug("Bridge " + this.name + " being stopped");
       
-         // TODO: Remove this during merge:
-         // If we close the csf, at the same time we could have the bridge calling close and proper cancellations (not just reseting as we used to do)
-         // we could have either Dead locks or very slow shutdowns on the testsuite.
-         // The solution I could find so far was to just leave the csf on
-      
-          // TODO: Need to find a better way to close the CSF
-      
-      
-//      if (started)
-//      {
-//         executor.execute(new Runnable()
-//         {
-//            public void run()
-//            {
-//               // We need to stop the csf here otherwise the stop runnable never runs since the createobjectsrunnable is
-//               // trying to connect to the target
-//               // server which isn't up in an infinite loop
-//               if (csf != null)
-//               {
-//                  csf.close();
-//                  csf = null; 
-//               }
-//            }
-//         });
-//      }
-//      
-      log.info("Bridge " + this.name + " being stopped");
-      
       stopping = true;
 
       executor.execute(new StopRunnable());
@@ -757,7 +730,6 @@
 
    private class StopRunnable implements Runnable
    {
-      Exception created = new Exception ("Stop bridge called at for session = " + session);
       public void run()
       {
          try
@@ -768,11 +740,10 @@
             // TODO: Why closing the CSF will make a few clustering and failover tests to 
             //       either deadlock or take forever on waiting 
             //       locks
-            //csf.close();
+            csf.close();
             csf = null;
             if (session != null)
             {
-               log.info("Stopping bridge called at ", created);
                log.info("Cleaning up session " + session);
                session.close();
                session.removeFailureListener(BridgeImpl.this);

Modified: branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
===================================================================
--- branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java	2011-06-14 15:05:40 UTC (rev 10802)
+++ branches/Branch_2_2_EAP-cluster-cleanup/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java	2011-06-15 01:22:16 UTC (rev 10803)
@@ -726,14 +726,21 @@
       }
    }
 
-   public synchronized void destroyBridge(final String name) throws Exception
+   public void destroyBridge(final String name) throws Exception
    {
-      Bridge bridge = bridges.remove(name);
-      if (bridge != null)
+      Bridge bridge;
+      
+      synchronized (this)
       {
-         bridge.stop();
-         managementService.unregisterBridge(name);
+         bridge = bridges.remove(name);
+         if (bridge != null)
+         {
+            bridge.stop();
+            managementService.unregisterBridge(name);
+         }
       }
+      
+      bridge.flushExecutor();
    }
 
    private synchronized void deployClusterConnection(final ClusterConnectionConfiguration config) throws Exception



More information about the hornetq-commits mailing list