|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.cluster.mcast.McastMembership
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 |
McastMembership.MbrEntry
Inner class that represents a member entry |
Field Summary | |
protected static McastMember[] |
EMPTY_MEMBERS
|
protected java.util.Map |
map
A map of all the members in the cluster. |
protected org.apache.catalina.cluster.mcast.McastMembership.MemberComparator |
memberComparator
sort members by alive time |
protected McastMember[] |
members
A list of all the members in the cluster. |
protected java.lang.String |
name
The name of this membership, has to be the same as the name for the local member |
Constructor Summary | |
McastMembership(java.lang.String name)
Constructs a new membership |
Method Summary | |
protected void |
addMcastMember(McastMember member)
Add a member to this component and sort array with memberComparator |
McastMember[] |
expire(long maxtime)
Runs a refresh cycle and returns a list of members that has expired. |
protected McastMembership.MbrEntry[] |
getMemberEntries()
get a copy from all member entries |
McastMember[] |
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(McastMember member)
Notify the membership that this member has announced itself. |
protected void |
removeMcastMember(McastMember member)
Remove a member from this component. |
void |
reset()
Reset the membership and start over fresh. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final McastMember[] EMPTY_MEMBERS
protected java.lang.String name
protected java.util.Map map
protected McastMember[] members
protected org.apache.catalina.cluster.mcast.McastMembership.MemberComparator memberComparator
Constructor Detail |
public McastMembership(java.lang.String name)
name
- - has to be the name of the local member. Used to filter the local member from the cluster membershipMethod Detail |
public void reset()
public boolean memberAlive(McastMember member)
member
- - the member that just pinged us
protected void addMcastMember(McastMember member)
member
- The member to addprotected void removeMcastMember(McastMember member)
member
- The member to removepublic McastMember[] expire(long maxtime)
maxtime
- - the max time a member can remain unannounced before it is considered dead.
public boolean hasMembers()
public McastMember[] getMembers()
protected McastMembership.MbrEntry[] getMemberEntries()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |