|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.tribe.gms.GroupMembershipService
This class defines a GroupMembershipService
Field Summary | |
static java.lang.String |
GMS_KEY
Destination key for GMS messages |
protected java.util.HashMap |
groupMemberships
|
protected java.util.ArrayList |
listeners
|
protected static Trace |
logger
|
Constructor Summary | |
GroupMembershipService(IpAddress replyAddress,
AbstractChannelPool channelPool,
DiscoveryService discovery)
Creates a new GroupMembershipService object |
Method Summary | |
void |
discoveryRequest(GroupIdentifier gid,
Address sender)
Callback when a discovery request for the given group is received. |
void |
failedMember(Member failed,
GroupIdentifier gid,
Member sender)
Callback when a group member is suspected of failure. |
Group |
getGroup(GroupIdentifier gid)
Get the list of members in a group. |
protected static Trace |
getLogger()
Returns the logger value. |
protected ReceiveBuffer |
getReceiveBuffer()
Returns the receiveBuffer value. |
void |
groupComposition(Group g,
Address sender)
Callback when a member sends its view of a group composition. |
Member |
join(ReliableGroupChannelWithGms channel,
GroupIdentifier gid)
Joins the group that has the given group identifier. |
void |
joinMember(Member m,
GroupIdentifier gid)
Callback when a new member joins a group. |
void |
quit(ReliableGroupChannelWithGms channel,
GroupIdentifier gid)
Leaves the group that has the given group identifier. |
void |
quitMember(Member m,
GroupIdentifier gid)
Callback when a member leaves a group (intentionally or not). |
void |
registerGroupMembershipListener(GroupMembershipListener listener)
Register a new GroupMembershipListener. |
void |
stop()
Stop this GMS service and its associated thread (note that the discovery service must be stopped separately). |
boolean |
unregisterGroupMembershipListener(GroupMembershipListener listener)
Unregister a GroupMembershipListener. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String GMS_KEY
protected java.util.HashMap groupMemberships
protected java.util.ArrayList listeners
protected static Trace logger
Constructor Detail |
public GroupMembershipService(IpAddress replyAddress, AbstractChannelPool channelPool, DiscoveryService discovery) throws ChannelException
GroupMembershipService
object
replyAddress
- address to send replies tochannelPool
- channel pool for group communicationsdiscovery
- the discovery service to use
ChannelException
- if no channel can be bound to the reply addressMethod Detail |
protected ReceiveBuffer getReceiveBuffer()
protected static Trace getLogger()
public Member join(ReliableGroupChannelWithGms channel, GroupIdentifier gid) throws AlreadyMemberException, NotConnectedException, ChannelException
channel
- client channel to join the groupgid
- the identifier of the group to join
AlreadyMemberException
- if we are already member of the group
NotConnectedException
- if the channel is not connected
ChannelException
- if an error is reported by the channelpublic void quit(ReliableGroupChannelWithGms channel, GroupIdentifier gid) throws ChannelException, NotConnectedException
channel
- client channel to leave the groupgid
- the identifier of the group to quit
ChannelException
- if an error occurs
NotConnectedException
- if m does not belong to this grouppublic Group getGroup(GroupIdentifier gid)
gid
- the group identifier
Group
corresponding to this gid or null if no
such group is registered in the GMS.public void registerGroupMembershipListener(GroupMembershipListener listener)
listener
- the listener to addpublic boolean unregisterGroupMembershipListener(GroupMembershipListener listener)
listener
- the listener to remove
public void discoveryRequest(GroupIdentifier gid, Address sender)
DiscoveryListener
discoveryRequest
in interface DiscoveryListener
gid
- group identifier requestedsender
- sender of the requestDiscoveryListener.discoveryRequest(org.objectweb.tribe.common.GroupIdentifier,
org.objectweb.tribe.common.Address)
public void groupComposition(Group g, Address sender)
GroupMembershipListener
groupComposition
in interface GroupMembershipListener
g
- the group compositionsender
- the member sending the group informationGroupMembershipListener.groupComposition(Group,
Address)
public void joinMember(Member m, GroupIdentifier gid)
GroupMembershipListener
joinMember
in interface GroupMembershipListener
m
- the new member.gid
- the group identifierGroupMembershipListener.joinMember(org.objectweb.tribe.common.Member,
org.objectweb.tribe.common.GroupIdentifier)
public void quitMember(Member m, GroupIdentifier gid)
GroupMembershipListener
quitMember
in interface GroupMembershipListener
m
- the member who left the group.gid
- the group identifierGroupMembershipListener.quitMember(org.objectweb.tribe.common.Member,
org.objectweb.tribe.common.GroupIdentifier)
public void failedMember(Member failed, GroupIdentifier gid, Member sender)
GroupMembershipListener
failedMember
in interface GroupMembershipListener
failed
- the member suspected of failuregid
- group identifiersender
- message sender (reporting the failure)GroupMembershipListener.failedMember(org.objectweb.tribe.common.Member,
org.objectweb.tribe.common.GroupIdentifier,
org.objectweb.tribe.common.Member)
public void stop()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |