| java.lang.Object org.jgroups.View
All known Subclasses: org.jgroups.MergeView,
View | public class View implements Externalizable,Cloneable,Streamable(Code) | | A view is a local representation of the current membership of a group.
Only one view is installed in a channel at a time.
Views contain the address of its creator, an ID and a list of member addresses.
These adresses are ordered, and the first address is always the coordinator of the view.
This way, each member of the group knows who the new coordinator will be if the current one
crashes or leaves the group.
The views are sent between members using the VIEW_CHANGE event.
|
Field Summary | |
protected Vector | members A list containing all the members of the view
This list is always ordered, with the coordinator being the first member. | protected ViewId | vid |
members | protected Vector members(Code) | | A list containing all the members of the view
This list is always ordered, with the coordinator being the first member.
the second member will be the new coordinator if the current one disappears
or leaves the group.
|
View | public View()(Code) | | creates an empty view, should not be used
|
View | public View(ViewId vid, Vector members)(Code) | | Creates a new view
Parameters: vid - The view id of this view (can not be null) Parameters: members - Contains a list of all the members in the view, can be empty but not null. |
View | public View(Address creator, long id, Vector members)(Code) | | Creates a new view
Parameters: creator - The creator of this view (can not be null) Parameters: id - The lamport timestamp of this view Parameters: members - Contains a list of all the members in the view, can be empty but not null. |
clone | public Object clone()(Code) | | creates a copy of this view
a copy of this view |
containsMember | public boolean containsMember(Address mbr)(Code) | | returns true, if this view contains a certain member
Parameters: mbr - - the address of the member, true if this view contains the member, false if it doesn'tif the argument mbr is null, this operation returns false |
getCreator | public Address getCreator()(Code) | | returns the creator of this view
if this view was created with the empty constructur, null will be returned
the creator of this view in form of an Address object |
getMembers | public Vector getMembers()(Code) | | Returns a reference to the List of members (ordered)
Do NOT change this list, hence your will invalidate the view
Make a copy if you have to modify it.
a reference to the ordered list of members in this view |
getVid | public ViewId getVid()(Code) | | returns the view ID of this view
if this view was created with the empty constructur, null will be returned
the view ID of this view |
serializedSize | public int serializedSize()(Code) | | |
size | public int size()(Code) | | returns the number of members in this view
the number of members in this view 0..n |
|
|