Interface SingletonElectionPolicy
public interface SingletonElectionPolicy
Elects a primary provider of a singleton service from a list of candidates.
- Author:
- Paul Ferraro
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionelect(List<GroupMember> candidates) Elect a single member from the specified list of candidate members.static SingletonElectionPolicyoldest()static SingletonElectionPolicyposition(int position) default SingletonElectionPolicyprefer(List<Predicate<GroupMember>> preferences) static SingletonElectionPolicyrandom()static SingletonElectionPolicyyoungest()
-
Field Details
-
SERVICE_DESCRIPTOR
-
-
Method Details
-
elect
Elect a single member from the specified list of candidate members.- Parameters:
candidates- a list of candidate members.- Returns:
- the elected member
-
prefer
-
random
-
oldest
-
youngest
-
position
-