|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.tribes.membership.Membership
public class Membership
A membership implementation using simple multicast. This is the representation of a multicast membership. This class is responsible for maintaining a list of active cluster nodes in the cluster. If a node fails to send out a heartbeat, the node will be dismissed.
Nested Class Summary | |
---|---|
protected static class |
Membership.MbrEntry
Inner class that represents a member entry |
Field Summary | |
---|---|
protected static MemberImpl[] |
EMPTY_MEMBERS
|
protected MemberImpl |
local
The name of this membership, has to be the same as the name for the local member |
protected HashMap<MemberImpl,Membership.MbrEntry> |
map
A map of all the members in the cluster. |
protected Comparator<Member> |
memberComparator
sort members by alive time |
protected MemberImpl[] |
members
A list of all the members in the cluster. |
Constructor Summary | |
---|---|
Membership(MemberImpl local)
|
|
Membership(MemberImpl local,
boolean includeLocal)
Constructs a new membership |
|
Membership(MemberImpl local,
Comparator<Member> comp)
|
|
Membership(MemberImpl local,
Comparator<Member> comp,
boolean includeLocal)
|
Method Summary | |
---|---|
Membership.MbrEntry |
addMember(MemberImpl member)
Add a member to this component and sort array with memberComparator |
Object |
clone()
|
boolean |
contains(Member mbr)
|
MemberImpl[] |
expire(long maxtime)
Runs a refresh cycle and returns a list of members that has expired. |
MemberImpl |
getMember(Member mbr)
|
protected Membership.MbrEntry[] |
getMemberEntries()
get a copy from all member entries |
MemberImpl[] |
getMembers()
Returning a list of all the members in the membership We not need a copy: add and remove generate new arrays. |
boolean |
hasMembers()
Returning that service has members or not |
boolean |
memberAlive(MemberImpl member)
Notify the membership that this member has announced itself. |
void |
removeMember(MemberImpl member)
Remove a member from this component. |
void |
reset()
Reset the membership and start over fresh. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final MemberImpl[] EMPTY_MEMBERS
protected MemberImpl local
protected HashMap<MemberImpl,Membership.MbrEntry> map
protected MemberImpl[] members
protected Comparator<Member> memberComparator
Constructor Detail |
---|
public Membership(MemberImpl local, boolean includeLocal)
local
- - has to be the name of the local member. Used to filter the local member from the cluster membershipincludeLocal
- - TBApublic Membership(MemberImpl local)
public Membership(MemberImpl local, Comparator<Member> comp)
public Membership(MemberImpl local, Comparator<Member> comp, boolean includeLocal)
Method Detail |
---|
public Object clone()
clone
in class Object
public void reset()
public boolean memberAlive(MemberImpl member)
member
- - the member that just pinged us
public Membership.MbrEntry addMember(MemberImpl member)
member
- The member to addpublic void removeMember(MemberImpl member)
member
- The member to removepublic MemberImpl[] expire(long maxtime)
maxtime
- - the max time a member can remain unannounced before it is considered dead.
public boolean hasMembers()
public MemberImpl getMember(Member mbr)
public boolean contains(Member mbr)
public MemberImpl[] getMembers()
protected Membership.MbrEntry[] getMemberEntries()
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |