|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jgroup.MemberTable
This class is an helper utility that provides application developers with
additional information about members of their current view. It can be
used as an hash table, to associate application-dependent information to
member identifier. It can be used to obtain information about the state
of member identifier with respect to both the current view and previous
installed views (for example, method
The table maintains information about a member until it crashes. A member
is declared crashed when a member identifier from the same host, but with
an higher incarnation identifier is inserted in the table. This means
that the JVM hosting the member has crashed, and a new one has started.
The state of crashed members is set to
This class implements the
Inner Class Summary | |
private class |
MemberTable.Record
Data structure used to maintain an element in the hashtable and its status. |
Field Summary | |
static int |
CRASHED
State assigned to members that have been declared crashed because a member identifier from the same host but with a new incarnation number has been inserted in the table. |
private java.util.HashMap |
iptable
|
static int |
MERGING
State assigned to members that merged the view after a previous partitioning |
static int |
NEWMEMBER
State assigned to new members |
static int |
NOTMEMBER
State assigned to member identifiers not included in the table |
static int |
PARTITIONED
State assigned to partitioned members for which no information is available. |
static int |
RECOVERING
State assigned to member identifiers whose incarnation number is greater than the incarnation number of other members previously contained in the table. |
static int |
SURVIVED
State assigned to members that survived from the previous view |
private java.util.HashMap |
table
|
Constructor Summary | |
MemberTable()
Build a new empty MemberTable . |
Method Summary | |
java.lang.Object[] |
elements()
Returns an array containing the values associated to all members contained in this |
java.lang.Object |
get(MemberId id)
Returns the value associated by this MemberTable to the specified member id. |
int |
getIndex(MemberId id)
Returns the position of the specified member identifier in the last view for which method |
int |
getState(MemberId id)
Returns the state associated to the member identifier. |
boolean |
isMember(MemberId id)
Returns true if the specified member identifier is member of the last view for which method |
void |
leaved()
No effect. |
MemberId[] |
members()
Returns an array containing the identifiers of all members contained in this |
void |
prepareChange()
No effect. |
void |
put(MemberId id,
java.lang.Object value)
Associates object |
void |
remove(MemberId id)
|
void |
viewChange(View view)
Update the information in the table with the information maintained in the new view. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int NOTMEMBER
public static final int PARTITIONED
public static final int CRASHED
public static final int RECOVERING
public static final int SURVIVED
public static final int MERGING
public static final int NEWMEMBER
private java.util.HashMap table
private java.util.HashMap iptable
Constructor Detail |
public MemberTable()
MemberTable
.Method Detail |
public int getState(MemberId id)
public int getIndex(MemberId id)
public void put(MemberId id, java.lang.Object value)
public java.lang.Object get(MemberId id)
id
- the member identifier used as keypublic void remove(MemberId id)
public java.lang.Object[] elements()
public MemberId[] members()
public boolean isMember(MemberId id)
id
- the member whose membership is tested.public void viewChange(View view)
viewChange
in interface MembershipListener
jgroup.MembershipListener
view
- the new view.MembershipService
public void leaved()
leaved
in interface MembershipListener
jgroup.MembershipListener
MembershipService
public void prepareChange()
prepareChange
in interface MembershipListener
jgroup.MembershipListener
MembershipService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |