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

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jun 29 09:51:40 EDT 2011


Author: borges
Date: 2011-06-29 09:51:40 -0400 (Wed, 29 Jun 2011)
New Revision: 10898

Modified:
   branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
HORNETQ-720 Initialize replicationEndpoint

Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java	2011-06-29 09:58:47 UTC (rev 10897)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java	2011-06-29 13:51:40 UTC (rev 10898)
@@ -87,6 +87,7 @@
 import org.hornetq.core.remoting.server.impl.RemotingServiceImpl;
 import org.hornetq.core.replication.ReplicationEndpoint;
 import org.hornetq.core.replication.ReplicationManager;
+import org.hornetq.core.replication.impl.ReplicationEndpointImpl;
 import org.hornetq.core.replication.impl.ReplicationManagerImpl;
 import org.hornetq.core.security.CheckType;
 import org.hornetq.core.security.Role;
@@ -992,11 +993,17 @@
 
    public synchronized ReplicationEndpoint connectToReplicationEndpoint(final Channel channel) throws Exception
    {
-      if (!configuration.isBackup())
+      if (configuration.isBackup())
       {
-         throw new HornetQException(HornetQException.ILLEGAL_STATE, "Connected server is not a backup server");
+         throw new HornetQException(HornetQException.ILLEGAL_STATE, "Connected server is a backup server");
       }
 
+      assert replicationEndpoint == null;
+      replicationEndpoint = new ReplicationEndpointImpl(this);
+
+      if (replicationEndpoint == null)
+         System.err.println("endpoint is null!");
+
       if (replicationEndpoint.getChannel() != null)
       {
          throw new HornetQException(HornetQException.ILLEGAL_STATE,



More information about the hornetq-commits mailing list