|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.View
public class View
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 java.util.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
|
Constructor Summary | |
---|---|
View()
creates an empty view, should not be used |
|
View(Address creator,
long id,
java.util.Vector members)
Creates a new view |
|
View(ViewId vid,
java.util.Vector members)
Creates a new view |
Method Summary | |
---|---|
java.lang.Object |
clone()
creates a copy of this view |
boolean |
containsMember(Address mbr)
returns true, if this view contains a certain member |
boolean |
equals(java.lang.Object obj)
|
Address |
getCreator()
returns the creator of this view if this view was created with the empty constructur, null will be returned |
java.util.Vector |
getMembers()
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. |
ViewId |
getVid()
returns the view ID of this view if this view was created with the empty constructur, null will be returned |
java.lang.String |
printDetails()
debug only |
void |
readExternal(java.io.ObjectInput in)
|
void |
readFrom(java.io.DataInputStream in)
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed |
int |
serializedSize()
|
int |
size()
returns the number of members in this view |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
void |
writeTo(java.io.DataOutputStream out)
Write the entire state of the current object (including superclasses) to outstream. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ViewId vid
protected java.util.Vector members
Constructor Detail |
---|
public View()
public View(ViewId vid, java.util.Vector members)
vid
- The view id of this view (can not be null)members
- Contains a list of all the members in the view, can be empty but not null.public View(Address creator, long id, java.util.Vector members)
creator
- The creator of this view (can not be null)id
- The lamport timestamp of this viewmembers
- Contains a list of all the members in the view, can be empty but not null.Method Detail |
---|
public ViewId getVid()
public Address getCreator()
public java.util.Vector getMembers()
public boolean containsMember(Address mbr)
mbr
- - the address of the member,
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int size()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String printDetails()
public java.lang.String toString()
toString
in class java.lang.Object
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void writeTo(java.io.DataOutputStream out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
java.io.IOException
public void readFrom(java.io.DataInputStream in) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.InstantiationException
Streamable
readFrom
in interface Streamable
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
public int serializedSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |