[hornetq-commits] JBoss hornetq SVN: r8522 - in trunk/src/main/org/hornetq/core: remoting/server/impl and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Dec 3 06:03:27 EST 2009


Author: jmesnil
Date: 2009-12-03 06:03:26 -0500 (Thu, 03 Dec 2009)
New Revision: 8522

Modified:
   trunk/src/main/org/hornetq/core/remoting/server/RemotingService.java
   trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
   trunk/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
   trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
server shutdown

* splitting RemotingService.stop() in pause() and stop()
* in-between, stop the replication manager

Modified: trunk/src/main/org/hornetq/core/remoting/server/RemotingService.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/server/RemotingService.java	2009-12-03 10:43:37 UTC (rev 8521)
+++ trunk/src/main/org/hornetq/core/remoting/server/RemotingService.java	2009-12-03 11:03:26 UTC (rev 8522)
@@ -45,4 +45,6 @@
    void freeze();
 
    RemotingConnection getServerSideReplicatingConnection();
+
+   void pause() throws Exception;
 }

Modified: trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java	2009-12-03 10:43:37 UTC (rev 8521)
+++ trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java	2009-12-03 11:03:26 UTC (rev 8522)
@@ -209,8 +209,8 @@
          }
       }
    }
-   
-   public void stop() throws Exception
+
+   public void pause() throws Exception
    {
       if (!started)
       {
@@ -224,6 +224,14 @@
       {
          acceptor.pause();
       }
+   }
+   
+   public void stop() throws Exception
+   {
+      if (!started)
+      {
+         return;
+      }
 
       synchronized (server)
       {

Modified: trunk/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java	2009-12-03 10:43:37 UTC (rev 8521)
+++ trunk/src/main/org/hornetq/core/replication/impl/ReplicationManagerImpl.java	2009-12-03 11:03:26 UTC (rev 8522)
@@ -83,6 +83,8 @@
    
    private final ExecutorFactory executorFactory;
 
+   private SessionFailureListener failureListener;
+
    // Static --------------------------------------------------------
 
    // Constructors --------------------------------------------------
@@ -326,7 +328,7 @@
 
       mainChannel.sendBlocking(replicationStartPackage);
 
-      failoverManager.addFailureListener(new SessionFailureListener()
+      failureListener = new SessionFailureListener()
       {
          public void connectionFailed(HornetQException me)
          {
@@ -353,7 +355,8 @@
          public void beforeReconnect(HornetQException me)
          {
          }
-      });
+      };
+      failoverManager.addFailureListener(failureListener);
 
       started = true;
 
@@ -393,7 +396,7 @@
       }
 
       failoverManager.causeExit();
-      
+      failoverManager.removeFailureListener(failureListener);
       if (replicatingConnection != null)
       {
          replicatingConnection.destroy();

Modified: trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2009-12-03 10:43:37 UTC (rev 8521)
+++ trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2009-12-03 11:03:26 UTC (rev 8522)
@@ -357,6 +357,14 @@
       }
 
       // we stop the remoting service outside a lock
+      remotingService.pause();
+
+      if (replicationManager != null)
+      {
+         replicationManager.stop();
+         replicationManager = null;
+      }
+      
       remotingService.stop();
 
       synchronized (this)
@@ -395,24 +403,12 @@
             storageManager.stop();
          }
 
-         if (replicationManager != null)
-         {
-            replicationManager.stop();
-            replicationManager = null;
-         }
-
          if (replicationEndpoint != null)
          {
             replicationEndpoint.stop();
             replicationEndpoint = null;
          }
 
-         if (replicationManager != null)
-         {
-            replicationManager.stop();
-            replicationManager = null;
-         }
-
          if (securityManager != null)
          {
             securityManager.stop();



More information about the hornetq-commits mailing list