Class LiveNodeLocator
- java.lang.Object
-
- org.apache.activemq.artemis.core.server.LiveNodeLocator
-
- All Implemented Interfaces:
ClusterTopologyListener
- Direct Known Subclasses:
AnyLiveNodeLocatorForReplication,AnyLiveNodeLocatorForScaleDown,NamedLiveNodeIdLocatorForReplication,NamedLiveNodeLocatorForReplication,NamedLiveNodeLocatorForScaleDown,NamedNodeIdNodeLocator
public abstract class LiveNodeLocator extends Object implements ClusterTopologyListener
A class that will locate a particular live server running in a cluster. How this live 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 Modifier and Type Class Description static interfaceLiveNodeLocator.BackupRegistrationListener
-
Constructor Summary
Constructors Constructor Description LiveNodeLocator()Use this constructor when the LiveNodeLocator is used for scaling down rather than replicatingLiveNodeLocator(LiveNodeLocator.BackupRegistrationListener backupRegistrationListener)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidconnectToCluster(ServerLocatorInternal serverLocator)connects to the clusterabstract Pair<TransportConfiguration,TransportConfiguration>getLiveConfiguration()Returns the current connectorabstract StringgetNodeID()Returns the node id for the current connectorabstract voidlocateNode()Locates a possible live server in a clusterabstract voidlocateNode(long timeout)Locates a possible live server in a cluster with a timeoutvoidnotifyRegistrationFailed(boolean alreadyReplicating)tells the locator the the current connector has failed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.api.core.client.ClusterTopologyListener
nodeDown, nodeUP
-
-
-
-
Constructor Detail
-
LiveNodeLocator
public LiveNodeLocator(LiveNodeLocator.BackupRegistrationListener backupRegistrationListener)
-
LiveNodeLocator
public LiveNodeLocator()
Use this constructor when the LiveNodeLocator is used for scaling down rather than replicating
-
-
Method Detail
-
locateNode
public abstract void locateNode(long timeout) throws ActiveMQExceptionLocates a possible live server in a cluster with a timeout- Throws:
ActiveMQException
-
locateNode
public abstract void locateNode() throws ActiveMQExceptionLocates a possible live server in a cluster- Throws:
ActiveMQException
-
getLiveConfiguration
public abstract Pair<TransportConfiguration,TransportConfiguration> getLiveConfiguration()
Returns the current connector
-
getNodeID
public abstract String getNodeID()
Returns the node id for the current connector
-
notifyRegistrationFailed
public void notifyRegistrationFailed(boolean alreadyReplicating)
tells the locator the the current connector has failed.
-
connectToCluster
public void connectToCluster(ServerLocatorInternal serverLocator) throws ActiveMQException
connects to the cluster- Throws:
ActiveMQException
-
-