public class ClusterLeaderServiceCuratorImpl extends java.lang.Object implements ClusterLeaderService
ClusterLeaderService
using Spring's LeaderInitiator
(Zookeeper/Curator based
leader election mechanism).Constructor and Description |
---|
ClusterLeaderServiceCuratorImpl(org.springframework.integration.zookeeper.leader.LeaderInitiator leaderInitiator)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isLeader()
Whether or not this node is the current cluster leader.
|
boolean |
isRunning()
Whether or not this node is participating in the cluster leader election.
|
void |
start()
Start the service (i.e.
|
void |
stop()
Stop the service (i.e.
|
public ClusterLeaderServiceCuratorImpl(org.springframework.integration.zookeeper.leader.LeaderInitiator leaderInitiator)
leaderInitiator
- the leader initiator componentpublic void stop()
stop
in interface ClusterLeaderService
public void start()
start
in interface ClusterLeaderService
public boolean isRunning()
isRunning
in interface ClusterLeaderService
public boolean isLeader()
isLeader
in interface ClusterLeaderService