|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
MemberTable |
getMemberTable()
Returns a MemberTable helper that will notified by the object. |
MemberId |
getMyIdentifier()
Returns the member identifier of the member. |
void |
join()
Requests to join the default group. |
void |
join(int gid)
Requests to join a group identified by gid. |
void |
leave()
Request to leave a group. |
Method Detail |
public void join(int gid) throws JgroupException
When requesting a group manager, a server may specify a port number to be used through a jgroup.TransportConfig object. Each specified port number in a Java virtual machine is controlled by a transport layer. Multiple objects joining different groups may share the facilities provided by a single transport layer by using the same communication port when requesting a group manager. In this case, the group identifier is used to distinguish multiple groups.
gid
- Non-negative integer identifying the groupjava.lang.IllegalArgumentException
- If gid is negative.JgroupException
- if the group manager receives a request to join a group for which it
is already member.public void join() throws JgroupException
When each group is associated to a distinct communication port, servers may join a group using a default group identifier.
JgroupException
- if the group manager receives a request to join a group for which it
is already member.public void leave() throws JgroupException
JgroupException
- If the group manager is not member of any group,
or is already leaving its current group.public MemberId getMyIdentifier()
public MemberTable getMemberTable()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |