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
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).
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionUse this constructor when the NodeLocator is used for scaling down rather than replicatingNodeLocator(NodeLocator.BackupRegistrationListener backupRegistrationListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectToCluster(ServerLocatorInternal serverLocator) connects to the clusterabstract StringReturns the node id for the current connector.abstract Pair<TransportConfiguration,TransportConfiguration> Returns the current connector.abstract voidLocates a server in a clusterabstract voidlocateNode(long timeout) Locates a server in a cluster with a timeoutvoidnotifyRegistrationFailed(boolean alreadyReplicating) tells the locator the current connector has failed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.api.core.client.ClusterTopologyListener
nodeDown, nodeUP
-
Constructor Details
-
NodeLocator
-
NodeLocator
public NodeLocator()Use this constructor when the NodeLocator is used for scaling down rather than replicating
-
-
Method Details
-
locateNode
Locates a server in a cluster with a timeout- Throws:
ActiveMQException
-
locateNode
Locates a server in a cluster- Throws:
ActiveMQException
-
getPrimaryConfiguration
Returns the current connector.- Returns:
- the current connector
-
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
connects to the cluster- Throws:
ActiveMQException
-