Class NodeLocator

java.lang.Object
org.apache.activemq.artemis.core.server.NodeLocator
All Implemented Interfaces:
ClusterTopologyListener
Direct Known Subclasses:
AnyNodeLocatorForReplication, AnyNodeLocatorForScaleDown, NamedNodeIdLocatorForReplication, NamedNodeIdNodeLocator, NamedNodeLocatorForReplication, NamedNodeLocatorForScaleDown

public abstract class NodeLocator extends Object implements ClusterTopologyListener
A class that will locate a particular server running in a cluster. How this server is chosen is a job for the implementation.

This is used for replication (which needs a QuorumManager) and scaling-down (which does not need a QuorumManager).

  • Constructor Details

    • NodeLocator

      public NodeLocator(NodeLocator.BackupRegistrationListener backupRegistrationListener)
    • NodeLocator

      public NodeLocator()
      Use this constructor when the NodeLocator is used for scaling down rather than replicating
  • Method Details

    • locateNode

      public abstract void locateNode(long timeout) throws ActiveMQException
      Locates a server in a cluster with a timeout
      Throws:
      ActiveMQException
    • locateNode

      public abstract void locateNode() throws ActiveMQException
      Locates a server in a cluster
      Throws:
      ActiveMQException
    • getPrimaryConfiguration

      public abstract Pair<TransportConfiguration,TransportConfiguration> getPrimaryConfiguration()
      Returns the current connector.
      Returns:
      the current connector
    • getNodeID

      public abstract String getNodeID()
      Returns the node id for the current connector.
      Returns:
      the node id for the current connector
    • notifyRegistrationFailed

      public void notifyRegistrationFailed(boolean alreadyReplicating)
      tells the locator the current connector has failed.
    • connectToCluster

      public void connectToCluster(ServerLocatorInternal serverLocator) throws ActiveMQException
      connects to the cluster
      Throws:
      ActiveMQException