Examples of NodeAnnounceMessage


Examples of org.hornetq.core.protocol.core.impl.wireformat.NodeAnnounceMessage

            }
         }
         else if (packet.getType() == PacketImpl.NODE_ANNOUNCE)
         {
            NodeAnnounceMessage msg = (NodeAnnounceMessage)packet;

            Pair<TransportConfiguration, TransportConfiguration> pair;
            if (msg.isBackup())
            {
               pair = new Pair<TransportConfiguration, TransportConfiguration>(null, msg.getConnector());
            }
            else
            {
               pair = new Pair<TransportConfiguration, TransportConfiguration>(msg.getConnector(), msg.getBackupConnector());
            }
            if (isTrace)
            {
               HornetQLogger.LOGGER.trace("Server " + server + " receiving nodeUp from NodeID=" + msg.getNodeID() + ", pair=" + pair);
            }

            if (acceptorUsed != null)
            {
               ClusterConnection clusterConn = acceptorUsed.getClusterConnection();
               if (clusterConn != null)
               {
                  clusterConn.nodeAnnounced(msg.getCurrentEventID(), msg.getNodeID(), msg.getNodeName(), pair, msg.isBackup());
               }
               else
               {
                  HornetQLogger.LOGGER.debug("Cluster connection is null on acceptor = " + acceptorUsed);
               }
            }
            else
            {
               HornetQLogger.LOGGER.debug("there is no acceptor used configured at the CoreProtocolManager " + this);
            }
         } else if (packet.getType() == PacketImpl.BACKUP_REGISTRATION)
         {
            BackupRegistrationMessage msg = (BackupRegistrationMessage)packet;
            ClusterConnection clusterConnection = acceptorUsed.getClusterConnection();

            if (clusterConnection.verify(msg.getClusterUser(), msg.getClusterPassword()))
            {
               try
               {
                  server.startReplication(rc, clusterConnection, getPair(msg.getConnector(), true),
                                          msg.isFailBackRequest());
               }
               catch(HornetQAlreadyReplicatingException are)
               {
                  channel0.send(new BackupReplicationStartFailedMessage(BackupReplicationStartFailedMessage.BackupRegistrationProblem.ALREADY_REPLICATING));
               }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.