Class AnyNodeLocatorForReplication
java.lang.Object
org.apache.activemq.artemis.core.server.NodeLocator
org.apache.activemq.artemis.core.server.impl.AnyNodeLocatorForReplication
- All Implemented Interfaces:
ClusterTopologyListener
This implementation looks for any available node, once tried with no success it is marked as tried and the next
available is used.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.activemq.artemis.core.server.NodeLocator
NodeLocator.BackupRegistrationListener -
Constructor Summary
ConstructorsConstructorDescriptionAnyNodeLocatorForReplication(NodeLocator.BackupRegistrationListener backupRegistrationListener, ActiveMQServerImpl server, long retryReplicationWait) -
Method Summary
Modifier and TypeMethodDescriptionReturns the node id for the current connector.Returns the current connector.voidLocates a server in a clustervoidlocateNode(long timeout) Locates a server in a cluster with a timeoutvoidif a node goes down we try all the connectors again as one may now be available for replicationvoidnodeUP(TopologyMember topologyMember, boolean last) Triggered when a node joins the cluster.voidnotifyRegistrationFailed(boolean alreadyReplicating) tells the locator the current connector has failed.Methods inherited from class org.apache.activemq.artemis.core.server.NodeLocator
connectToCluster
-
Constructor Details
-
AnyNodeLocatorForReplication
public AnyNodeLocatorForReplication(NodeLocator.BackupRegistrationListener backupRegistrationListener, ActiveMQServerImpl server, long retryReplicationWait)
-
-
Method Details
-
locateNode
Description copied from class:NodeLocatorLocates a server in a cluster- Specified by:
locateNodein classNodeLocator- Throws:
ActiveMQException
-
locateNode
Description copied from class:NodeLocatorLocates a server in a cluster with a timeout- Specified by:
locateNodein classNodeLocator- Throws:
ActiveMQException
-
nodeUP
Description copied from interface:ClusterTopologyListenerTriggered when a node joins the cluster.last- if the whole cluster topology is being transmitted (after adding the listener to the cluster connection) this parameter will betruefor the last topology member.
-
nodeDown
if a node goes down we try all the connectors again as one may now be available for replicationTODO: there will be a better way to do this by finding which nodes backup has gone down.
nodeID- the id of the node leaving the cluster
-
getNodeID
Description copied from class:NodeLocatorReturns the node id for the current connector.- Specified by:
getNodeIDin classNodeLocator- Returns:
- the node id for the current connector
-
getPrimaryConfiguration
Description copied from class:NodeLocatorReturns the current connector.- Specified by:
getPrimaryConfigurationin classNodeLocator- Returns:
- the current connector
-
notifyRegistrationFailed
public void notifyRegistrationFailed(boolean alreadyReplicating) Description copied from class:NodeLocatortells the locator the current connector has failed.- Overrides:
notifyRegistrationFailedin classNodeLocator
-