|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MembershipService
The facilities provided by the group membership service included in
Jgroup may be accessed using the MembershipService
interface. Methods in this interfaces enable objects to become
members of a group and subsequentially leave it.
Instances of MembershipService
may be obtained through
the GroupManager
class.
GroupManager
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface jgroup.core.Layer |
---|
Layer.FinalizeLayer |
Method Summary | |
---|---|
int |
getGid()
Returns the group identifier. |
int |
getMemberIndex()
Position index of this member in the array containing the local members of the current view. |
MemberTable |
getMemberTable()
Returns a MemberTable helper object that will be
notified of changes in the membership. |
MemberId |
getMyIdentifier()
Returns the member identifier of the local member. |
int |
getViewIndex()
Position index of this member in the array containing the members of the current view. |
boolean |
isJoining()
Returns true if the GroupManager is in the process of
joining some group. |
boolean |
isLeader()
Returns true if the local member is the group leader. |
boolean |
isMember()
Returns true if the GroupManager is member of some
group. |
boolean |
isMemberOrJoining()
Returns true if the GroupManager is member of some group
or is in the process of joining some group. |
void |
join()
Requests to join the default group associated with the Jgroup daemon. |
void |
join(int groupId)
Requests to join a group identified by groupId . |
void |
leave()
Request to leave a group. |
int |
members()
Return the number of members of this group. |
Methods inherited from interface jgroup.core.Layer |
---|
addListener |
Methods inherited from interface jgroup.core.Layer.FinalizeLayer |
---|
complete |
Method Detail |
---|
void join(int groupId) throws JgroupException
groupId
.
groupId
- Non-negative integer identifying the group.
java.lang.IllegalArgumentException
- Raised if groupId
is negative.
JgroupException
- Raised if the membership service receives a request to join a
group to which it is already a member.void join() throws JgroupException
Each Jgroup daemon has a default group. If a Jgroup daemon does not need to be shared by multiple groups, the application servers may simply join the default group without having to specify group identifiers.
JgroupException
- Raised if the membership service receives a request to join a
group to which it is already a member.void leave() throws JgroupException
hasLeft
method is invoked. After this invocation,
the member will not receive any further event notification related
to the group.
JgroupException
- Rasied if the server is not member of any group, or is already
leaving its current group.boolean isMember()
GroupManager
is member of some
group. Otherwise, false is returned.
boolean isJoining()
GroupManager
is in the process of
joining some group. Otherwise, false is returned.
boolean isMemberOrJoining()
GroupManager
is member of some group
or is in the process of joining some group. Otherwise, false is returned.
boolean isLeader()
MemberId getMyIdentifier()
int getGid()
MemberTable getMemberTable()
MemberTable
helper object that will be
notified of changes in the membership. This is used to provide
application developers with additional information about members
of their current view.
int members()
int getViewIndex()
int getMemberIndex()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |