com.twitter.common.zookeeper
Interface Candidate.Leader

Enclosing interface:
Candidate

public static interface Candidate.Leader

Encapsulates a leader that can be elected and subsequently defeated.


Method Summary
 void onDefeated()
          Called when the leader has been ousted.
 void onElected(ExceptionalCommand<Group.JoinException> abdicate)
          Called when this leader has been elected.
 

Method Detail

onElected

void onElected(ExceptionalCommand<Group.JoinException> abdicate)
Called when this leader has been elected.

Parameters:
abdicate - a command that can be used to abdicate leadership and force a new election

onDefeated

void onDefeated()
Called when the leader has been ousted. Can occur either if the leader abdicates or if an external event causes the leader to lose its leadership role (session expiration).