[hornetq-commits] JBoss hornetq SVN: r10935 - branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jul 6 11:50:53 EDT 2011


Author: borges
Date: 2011-07-06 11:50:53 -0400 (Wed, 06 Jul 2011)
New Revision: 10935

Modified:
   branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
Log:
HORNETQ-720 Stop sending the CreateReplication msg.

Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java	2011-07-06 15:49:45 UTC (rev 10934)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java	2011-07-06 15:50:53 UTC (rev 10935)
@@ -35,7 +35,6 @@
 import org.hornetq.core.protocol.core.Packet;
 import org.hornetq.core.protocol.core.impl.ChannelImpl.CHANNEL_ID;
 import org.hornetq.core.protocol.core.impl.PacketImpl;
-import org.hornetq.core.protocol.core.impl.wireformat.CreateReplicationSessionMessage;
 import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddMessage;
 import org.hornetq.core.protocol.core.impl.wireformat.ReplicationAddTXMessage;
 import org.hornetq.core.protocol.core.impl.wireformat.ReplicationCommitMessage;
@@ -314,42 +313,7 @@
       }
 
       replicatingChannel.setHandler(responseHandler);
-
-      CreateReplicationSessionMessage replicationStartPackage =
-               new CreateReplicationSessionMessage(replicatingChannel.getID());
-
-      Channel systemChannel = remotingConnection.getChannel(CHANNEL_ID.SESSION.id, -1);
-
-      systemChannel.send(replicationStartPackage);
-
-      failureListener = new SessionFailureListener()
-      {
-         public void connectionFailed(final HornetQException me, boolean failedOver)
-         {
-            if (me.getCode() == HornetQException.DISCONNECTED)
-            {
-               // Backup has shut down - no need to log a stack trace
-               ReplicationManagerImpl.log.warn("The backup node has been shut-down, replication will now stop");
-            }
-            else
-            {
-               ReplicationManagerImpl.log.warn("Connection to the backup node failed, removing replication now", me);
-            }
-
-            try
-            {
-               stop();
-            }
-            catch (Exception e)
-            {
-               ReplicationManagerImpl.log.warn(e.getMessage(), e);
-            }
-         }
-
-         public void beforeReconnect(final HornetQException me)
-         {
-         }
-      };
+      failureListener = new ReplicatedSessionFailureListener();
       remotingConnection.addFailureListener(failureListener);
 
       started = true;
@@ -486,8 +450,37 @@
 
    // Inner classes -------------------------------------------------
 
-   protected class ResponseHandler implements ChannelHandler
+   private final class ReplicatedSessionFailureListener implements SessionFailureListener
    {
+      public void connectionFailed(final HornetQException me, boolean failedOver)
+      {
+         if (me.getCode() == HornetQException.DISCONNECTED)
+         {
+            // Backup has shut down - no need to log a stack trace
+            ReplicationManagerImpl.log.warn("The backup node has been shut-down, replication will now stop");
+         }
+         else
+         {
+            ReplicationManagerImpl.log.warn("Connection to the backup node failed, removing replication now", me);
+         }
+
+         try
+         {
+            stop();
+         }
+         catch (Exception e)
+         {
+            ReplicationManagerImpl.log.warn(e.getMessage(), e);
+         }
+      }
+
+      public void beforeReconnect(final HornetQException me)
+      {
+      }
+   }
+
+   private class ResponseHandler implements ChannelHandler
+   {
       /* (non-Javadoc)
        * @see org.hornetq.core.remoting.ChannelHandler#handlePacket(org.hornetq.core.remoting.Packet)
        */



More information about the hornetq-commits mailing list