public static class LeaderElection.Adapter extends Object implements LeaderElection.Listener
LeaderElection.Listener.| Constructor and Description |
|---|
Adapter() |
| 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.
|
public void onWin(LeaderElection election)
LeaderElection.ListeneronStateChanged().onWin in interface LeaderElection.Listenerelection - The LeaderElection instance which this
listener is associated with.public void onLose(LeaderElection election)
LeaderElection.ListeneronStateChanged().onLose in interface LeaderElection.Listenerelection - The LeaderElection instance which this
listener is associated with.public void onVacant(LeaderElection election)
LeaderElection.ListeneronStateChanged().onVacant in interface LeaderElection.Listenerelection - The LeaderElection instance which this
listener is associated with.public void onFinish(LeaderElection election)
LeaderElection.ListeneronStateChanged().onFinish in interface LeaderElection.Listenerelection - The LeaderElection instance which this
listener is associated with.public void onStateChanged(LeaderElection election, LeaderElection.State oldState, LeaderElection.State newState)
LeaderElection.ListeneronXxx methods
(onWin(),
onLose(), onVacant() and onFinish()).onStateChanged in interface LeaderElection.Listenerelection - 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.