Package org.hornetq.core.client.impl

Examples of org.hornetq.core.client.impl.TopologyMember


      // Just take the first one for now
      ClusterConnection cc = clusterConnections.values().iterator().next();

      String nodeID = server.getNodeID().toString();

      TopologyMember member = topology.getMember(nodeID);

      if (member == null)
      {
         if (backup)
         {
            member = new TopologyMember(new Pair<TransportConfiguration, TransportConfiguration>(null, cc.getConnector()), 0);
         }
         else
         {
            member = new TopologyMember(new Pair<TransportConfiguration, TransportConfiguration>(cc.getConnector(), null), 0);
         }

         topology.addMember(nodeID, member);
      }
      else
      {
         if (backup)
         {
           // pair.b = cc.getConnector();
         }
         else
         {
           // pair.a = cc.getConnector();
         }
      }

      // Propagate the announcement

      for (ClusterTopologyListener listener : clientListeners)
      {
         listener.nodeUP(nodeID, member.getConnector(), false, member.getDistance());
      }
     
      for (ClusterTopologyListener listener : clusterConnectionListeners)
      {
         listener.nodeUP(nodeID, member.getConnector(), false, member.getDistance());
      }

   }
View Full Code Here


      if (log.isDebugEnabled())
      {
         log.debug(this + "::NodeAnnounced, backup=" + backup + nodeID + connectorPair);
      }

      TopologyMember newMember = new TopologyMember(connectorPair.getA(), connectorPair.getB());
      newMember.setUniqueEventID(uniqueEventID);
      if (backup)
      {
         topology.updateBackup(nodeID, new TopologyMember(connectorPair.getA(), connectorPair.getB()));
      }
      else
      {
         topology.updateMember(uniqueEventID, nodeID, newMember);
      }
View Full Code Here

   /* (non-Javadoc)
    * @see org.hornetq.core.client.impl.AfterConnectInternalListener#onConnection(org.hornetq.core.client.impl.ClientSessionFactoryInternal)
    */
   public void onConnection(ClientSessionFactoryInternal sf)
   {
      TopologyMember localMember = getLocalMember();
      if (localMember != null)
      {
         sf.sendNodeAnnounce(localMember.getUniqueEventID(),
                             manager.getNodeId(),
                             false,
                             localMember.getConnector().getA(),
                             localMember.getConnector().getB());
      }
      else
      {
         log.warn("LocalMember is not set at on ClusterConnection " + this);
      }
View Full Code Here

         log.debug("Activating cluster connection nodeID=" + nodeUUID + " for server=" + this.server);
      }

      backup = false;

      topology.updateAsLive(manager.getNodeId(), new TopologyMember(connector, null));

      if (backupServerLocator != null)
      {
         // todo we could use the topology of this to preempt it arriving from the cc
         try
         {
            backupServerLocator.close();
         }
         catch (Exception e)
         {
            log.warn("problem closing backup session factory", e);
         }
         backupServerLocator = null;
      }

      serverLocator = clusterConnector.createServerLocator();

      if (serverLocator != null)
      {

         if (!useDuplicateDetection)
         {
            log.debug("DuplicateDetection is disabled, sending clustered messages blocked");
         }

         final TopologyMember currentMember = topology.getMember(manager.getNodeId());

         if (currentMember == null)
         {
            // sanity check only
            throw new IllegalStateException("InternalError! The ClusterConnection doesn't know about its own node = " + this);
View Full Code Here

   public synchronized void informTopology()
   {
      String nodeID = server.getNodeID().toString();

      TopologyMember localMember;

      if (backup)
      {
         localMember = new TopologyMember(null, connector);
      }
      else
      {
         localMember = new TopologyMember(connector, null);
      }

      topology.updateAsLive(nodeID, localMember);
   }
View Full Code Here

   public void notifyNodeUp(String nodeID,
                                   Pair<TransportConfiguration, TransportConfiguration> connectorPair,
                                   boolean last,
                                   int distance)
   {
      boolean updated = topology.addMember(nodeID, new TopologyMember(connectorPair, distance));

      if(!updated)
      {
         return;
      }
View Full Code Here

      {
         backup = false;

         String nodeID = server.getNodeID().toString();

         TopologyMember member = topology.getMember(nodeID);
         //we swap the topology backup now = live
         if (member != null)
         {
            member.getConnector().a = member.getConnector().b;

            member.getConnector().b = null;
         }

         if(backupServerLocator != null)
         {
            //todo we could use the topology of this to preempt it arriving from the cc
            try
            {
               backupServerLocator.close();
            }
            catch (Exception e)
            {
               log.warn("problem closing backup session factory", e);
            }
            backupServerLocator = null;
         }

         for (BroadcastGroup broadcastGroup : broadcastGroups.values())
         {
            try
            {
               broadcastGroup.start();
               broadcastGroup.activate();
            }
            catch (Exception e)
            {
               log.warn("unable to start broadcast group " + broadcastGroup.getName(), e);
            }
         }

         for (ClusterConnection clusterConnection : clusterConnections.values())
         {
            try
            {
               clusterConnection.activate();
            }
            catch (Exception e)
            {
               log.warn("unable to start cluster connection " + clusterConnection.getName(), e);
            }
         }

         for (Bridge bridge : bridges.values())
         {
            try
            {
               bridge.start();
            }
            catch (Exception e)
            {
               log.warn("unable to start bridge " + bridge.getName(), e);
            }
         }

         for (ClusterTopologyListener listener : clientListeners)
         {
            listener.nodeUP(nodeID, member.getConnector(), false, member.getDistance());
         }

         for (ClusterTopologyListener listener : clusterConnectionListeners)
         {
            listener.nodeUP(nodeID, member.getConnector(), false, member.getDistance());
         }
      }
   }
View Full Code Here

      // Just take the first one for now
      ClusterConnection cc = clusterConnections.values().iterator().next();

      String nodeID = server.getNodeID().toString();

      TopologyMember member = topology.getMember(nodeID);

      if (member == null)
      {
         if (backup)
         {
            member = new TopologyMember(new Pair<TransportConfiguration, TransportConfiguration>(null, cc.getConnector()), 0);
         }
         else
         {
            member = new TopologyMember(new Pair<TransportConfiguration, TransportConfiguration>(cc.getConnector(), null), 0);
         }

         topology.addMember(nodeID, member);
      }
      else
      {
         if (backup)
         {
           // pair.b = cc.getConnector();
         }
         else
         {
           // pair.a = cc.getConnector();
         }
      }

      // Propagate the announcement

      for (ClusterTopologyListener listener : clientListeners)
      {
         listener.nodeUP(nodeID, member.getConnector(), false, member.getDistance());
      }
     
      for (ClusterTopologyListener listener : clusterConnectionListeners)
      {
         listener.nodeUP(nodeID, member.getConnector(), false, member.getDistance());
      }

   }
View Full Code Here

TOP

Related Classes of org.hornetq.core.client.impl.TopologyMember

Copyright © 2018 www.massapicom. 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.