org.jgroups
public class Membership extends Object implements Cloneable
Field Summary | |
---|---|
protected static Log | log |
Constructor Summary | |
---|---|
Membership()
Public constructor
Creates a member ship object with zero members | |
Membership(Collection initial_members)
Creates a member ship object with the initial members.
|
Method Summary | |
---|---|
void | add(Address new_member)
Adds a new member to this membership.
|
void | add(Collection v)
Adds a list of members to this membership
|
void | clear()
removes all the members from this membership |
Object | clone() |
boolean | contains(Address member)
Returns true if the provided member belongs to this membership
|
Membership | copy()
returns a copy of this membership
|
Object | elementAt(int index)
Returns the component at the specified index
|
Vector | getMembers()
returns a copy (clone) of the members in this membership.
the vector returned is immutable in reference to this object.
ie, modifying the vector that is being returned in this method
will not modify this membership object.
|
void | merge(Collection new_mems, Collection suspects)
merges membership with the new members and removes suspects
The Merge method will remove all the suspects and add in the new members.
|
void | remove(Address old_member)
removes an member from the membership.
|
void | remove(Collection v)
removes all the members contained in v from this membership
|
void | set(Collection v)
Clear the membership and adds all members of v
This method will clear out all the old members of this membership by
invoking the Clear method.
|
void | set(Membership m)
Clear the membership and adds all members of v
This method will clear out all the old members of this membership by
invoking the Clear method.
|
int | size()
Returns the number of addresses in this membership
|
void | sort() |
String | toString() |
Parameters: initial_members - a list of members that belong to this membership
Parameters: v - a vector containing Address objects
Throws: ClassCastException if v contains objects that don't implement the Address interface
See Also: Membership
Returns: a clone of this object. The list of members is copied to a new container
Parameters: member
Returns: true if the member belongs to this membership
Returns: an exact copy of this membership
Parameters: index - 0..size()-1
Throws: ArrayIndexOutOfBoundsException - if the index is negative or not less than the current size of this Membership object.
See Also: java.util.Vector#elementAt
Returns: a list of members,
Parameters: new_mems - a vector containing a list of members (Address) to be added to this membership suspects - a vector containing a list of members (Address) to be removed from this membership
Parameters: old_member - the member to be removed
Parameters: v - a vector containing all the members to be removed
Clear
method.
Then it will add all the all members provided in the vector v
Parameters: v - a vector containing all the members this membership will contain
Clear
method.
Then it will add all the all members provided in the vector v
Parameters: m - a membership containing all the members this membership will contain
Returns: the number of addresses in this membership