public final class QuorumManager extends Object implements ClusterTopologyListener, ActiveMQComponent
Constructor and Description |
---|
QuorumManager(ExecutorService threadPool,
ClusterController clusterController) |
Modifier and Type | Method and Description |
---|---|
int |
getMaxClusterSize()
returns the maximum size this cluster has been.
|
void |
handleQuorumVote(Channel clusterChannel,
Packet packet) |
boolean |
hasLive(String nodeID,
int quorumSize,
int voteTimeout,
TimeUnit voteTimeoutUnit) |
boolean |
isStarted()
are we started
|
boolean |
isStillLive(String nodeID,
TransportConfiguration liveConnector,
int quorumSize,
int voteTimeout,
TimeUnit voteTimeoutUnit) |
void |
nodeDown(long eventUID,
String nodeID)
notify the
Quorum of a topology change. |
void |
nodeUP(TopologyMember topologyMember,
boolean last)
called by the
ServerLocatorInternal when the topology changes. |
void |
registerQuorum(Quorum quorum)
registers a
Quorum so that it can be notified of changes in the cluster. |
void |
registerQuorumHandler(QuorumVoteHandler quorumVoteHandler)
called to register vote handlers on the quorum
|
void |
start()
we start by simply creating the server locator and connecting in a separate thread
|
void |
stop()
stops the server locator
|
String |
toString() |
void |
unRegisterQuorum(Quorum quorum)
unregisters a
Quorum . |
void |
vote(QuorumVote quorumVote)
ask the quorum to vote within a specific quorum.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asyncStop
public QuorumManager(ExecutorService threadPool, ClusterController clusterController)
public void start() throws Exception
start
in interface ActiveMQComponent
Exception
public void stop() throws Exception
stop
in interface ActiveMQComponent
Exception
public boolean isStarted()
isStarted
in interface ActiveMQComponent
public void registerQuorum(Quorum quorum)
Quorum
so that it can be notified of changes in the cluster.quorum
- public void unRegisterQuorum(Quorum quorum)
Quorum
.quorum
- public void nodeUP(TopologyMember topologyMember, boolean last)
ServerLocatorInternal
when the topology changes. we update the
maxClusterSize
if needed and inform the Quorum
's.nodeUP
in interface ClusterTopologyListener
topologyMember
- the topolgy changedlast
- if the whole cluster topology is being transmitted (after adding the listener to
the cluster connection) this parameter will be true
for the last topologypublic void nodeDown(long eventUID, String nodeID)
Quorum
of a topology change.nodeDown
in interface ClusterTopologyListener
eventUID
- nodeID
- the id of the node leaving the clusterpublic boolean hasLive(String nodeID, int quorumSize, int voteTimeout, TimeUnit voteTimeoutUnit)
public boolean isStillLive(String nodeID, TransportConfiguration liveConnector, int quorumSize, int voteTimeout, TimeUnit voteTimeoutUnit)
public int getMaxClusterSize()
public void vote(QuorumVote quorumVote)
quorumVote
- the vote to acquirepublic void registerQuorumHandler(QuorumVoteHandler quorumVoteHandler)
quorumVoteHandler
- the vote handlerCopyright © 2021 JBoss by Red Hat. All rights reserved.