Package org.hornetq.core.client.impl

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


      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();
      sf.sendNodeAnnounce(localMember.getUniqueEventID(),
                          manager.getNodeId(),
                          false,
                          localMember.getConnector().getA(),
                          localMember.getConnector().getB());

      // sf.sendNodeAnnounce(System.currentTimeMillis(),
      // manager.getNodeId(),
      // false,
      // localMember.getConnector().a,
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(true);

      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

         assertEquals(1, topology.getMembers().size());

         factory.close();

         TopologyMember member = topology.getMembers().iterator().next();
         if (isNetty)
         {
            assertEquals(NettyConnectorFactory.class.getName(), member.getA().getFactoryClassName());
         }
         else
         {
            assertEquals(InVMConnectorFactory.class.getName(), member.getA().getFactoryClassName());
         }

      }
      finally
      {
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

                              final TransportConfiguration cfg1,
                              final TransportConfiguration cfg2)
   {
      Topology topology = serverParameter.getClusterManager().getClusterConnection(clusterName).getTopology();

      TopologyMember member1 = topology.getMember(nodeId1);
      TopologyMember member2 = topology.getMember(nodeId2);
      Assert.assertEquals(member1.getA().toString(), cfg1.toString());
      Assert.assertEquals(member2.getA().toString(), cfg2.toString());
   }
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.