Class LeaderInitiator.CuratorContext

java.lang.Object
org.springframework.integration.zookeeper.leader.LeaderInitiator.CuratorContext
All Implemented Interfaces:
Context
Enclosing class:
LeaderInitiator

public class LeaderInitiator.CuratorContext extends Object implements Context
Implementation of leadership context backed by Curator.
  • Method Details

    • isLeader

      public boolean isLeader()
      Description copied from interface: Context
      Checks if the Candidate this context was passed to is the leader.
      Specified by:
      isLeader in interface Context
      Returns:
      true if the Candidate this context was passed to is the leader
    • yield

      public void yield()
      Description copied from interface: Context
      Causes the Candidate this context was passed to to relinquish leadership. This method has no effect if the candidate is not currently the leader.
      Specified by:
      yield in interface Context
    • getRole

      public String getRole()
      Description copied from interface: Context
      Get the role for the Candidate.
      Specified by:
      getRole in interface Context
      Returns:
      the role.
    • getLeader

      public org.apache.curator.framework.recipes.leader.Participant getLeader()
      Get the leader
      Returns:
      the leader.
      Since:
      6.0.3
    • getParticipants

      public Collection<org.apache.curator.framework.recipes.leader.Participant> getParticipants()
      Get the list of participants
      Returns:
      list of participants.
      Since:
      6.0.3
    • toString

      public String toString()
      Overrides:
      toString in class Object