public static interface LeaderElection.Listener
Modifier and Type | Method and Description |
---|---|
void |
onFinish(LeaderElection election)
Called when it is detected that callback should not be called
any more.
|
void |
onLose(LeaderElection election)
Called when it is detected that another candidate is the leader.
|
void |
onStateChanged(LeaderElection election,
LeaderElection.State oldState,
LeaderElection.State newState)
Called when the state of the leader election changed.
|
void |
onVacant(LeaderElection election)
Called when it is detected that a leader does not exist.
|
void |
onWin(LeaderElection election)
Called when this candidate won a leader election.
|
void onWin(LeaderElection election)
onStateChanged()
.election
- The LeaderElection
instance which this
listener is associated with.void onLose(LeaderElection election)
onStateChanged()
.election
- The LeaderElection
instance which this
listener is associated with.void onVacant(LeaderElection election)
onStateChanged()
.election
- The LeaderElection
instance which this
listener is associated with.void onFinish(LeaderElection election)
onStateChanged()
.election
- The LeaderElection
instance which this
listener is associated with.void onStateChanged(LeaderElection election, LeaderElection.State oldState, LeaderElection.State newState)
onXxx
methods
(onWin()
,
onLose()
, onVacant()
and onFinish()
).election
- The LeaderElection
instance which this
listener is associated with.oldState
- The previous state before the change.newState
- The new state after the change.Copyright © 2015. All rights reserved.