|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.Membership
public class Membership
Represents a membership of a cluster group. Class Membership is not exposed to clients and is used by JGroups internally. The membership object holds a list of Address objects that are in the same membership. Each unique address can only exist once.
Constructor Summary | |
---|---|
Membership()
Creates a member ship object with zero members |
|
Membership(java.util.Collection<Address> initial_members)
Creates a Membership with a given initial members. |
Method Summary | |
---|---|
void |
add(Address... mbrs)
|
void |
add(Address new_member)
Adds a new member to this membership. |
void |
add(java.util.Collection<Address> v)
Adds a list of members to this membership |
void |
clear()
Removes all the members from this membership |
boolean |
contains(Address member)
Returns true if the provided member belongs to this membership |
Membership |
copy()
Returns a copy of this membership |
Address |
elementAt(int index)
Returns the component at the specified index |
java.util.List<Address> |
getMembers()
Returns a copy (clone) of the members in this membership. |
void |
merge(java.util.Collection<Address> new_mems,
java.util.Collection<Address> suspects)
Merges membership with the new members and removes suspects. |
void |
remove(Address old_member)
Removes an member from the membership. |
void |
remove(java.util.Collection<Address> v)
Removes all the members contained in v from this membership |
void |
retainAll(java.util.Collection<Address> v)
|
void |
set(java.util.Collection<Address> v)
Clears 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)
Clears the membership and adds all members of a given membership parameter. |
int |
size()
Returns the number of addresses in this membership |
void |
sort()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Membership()
public Membership(java.util.Collection<Address> initial_members)
initial_members
- - a list of members that belong to this membershipMethod Detail |
---|
public java.util.List<Address> getMembers()
public void add(Address new_member)
public void add(Address... mbrs)
public final void add(java.util.Collection<Address> v)
v
- - a vector containing Address objects
java.lang.ClassCastException
- if v contains objects that don't implement the Address interfacepublic void remove(Address old_member)
old_member
- - the member to be removedpublic void remove(java.util.Collection<Address> v)
v
- a list of all the members to be removedpublic void retainAll(java.util.Collection<Address> v)
public void clear()
public void set(java.util.Collection<Address> v)
Clear
method. Then it will add all the all
members provided in the vector v
v
- - a vector containing all the members this membership will containpublic void set(Membership m)
clear
method.
m
- - a membership containing all the members this membership will containpublic void merge(java.util.Collection<Address> new_mems, java.util.Collection<Address> suspects)
new_mems
- - a vector containing a list of members (Address) to be added to this membershipsuspects
- - a vector containing a list of members (Address) to be removed from this membershippublic boolean contains(Address member)
member
-
public void sort()
public Membership copy()
public int size()
public Address elementAt(int index)
index
- - 0..size()-1
java.lang.ArrayIndexOutOfBoundsException
- - if the index is negative or not less than the current size of this Membership
object.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |