org.objectweb.tribe.gms
Class JGroupsMembershipService

java.lang.Object
  extended byorg.objectweb.tribe.gms.GroupMembershipService
      extended byorg.objectweb.tribe.gms.JGroupsMembershipService
All Implemented Interfaces:
DiscoveryListener, GroupMembershipListener, org.jgroups.MembershipListener

public class JGroupsMembershipService
extends GroupMembershipService
implements org.jgroups.MembershipListener

This class defines a JGroupsMembershipService

Version:
1.0
Author:
Emmanuel Cecchet

Field Summary
 
Fields inherited from class org.objectweb.tribe.gms.GroupMembershipService
GMS_KEY, groupMemberships, listeners, logger
 
Constructor Summary
JGroupsMembershipService(java.net.URL jgroupsConfigFile)
          Creates a new JGroupsMembershipService object
 
Method Summary
 void block()
           
 org.jgroups.JChannel getJGroupsChannel()
          Gets underlying JGroups channel.
 Member join(ReliableGroupChannelWithGms channel, GroupIdentifier gid)
          Joins the group that has the given group identifier.
static Member memberFromJGroupsAddress(org.jgroups.stack.IpAddress jgroupsAddress)
          Returns a tribe Member object from a JGroups address (supposed to be an IpAddress).
 void quit(ReliableGroupChannelWithGms channel, GroupIdentifier gid)
          Leaves the group that has the given group identifier.
 void suspect(org.jgroups.Address suspectedMbr)
           
 void viewAccepted(org.jgroups.View newView)
           
 
Methods inherited from class org.objectweb.tribe.gms.GroupMembershipService
discoveryRequest, failedMember, getGroup, getLogger, getReceiveBuffer, groupComposition, joinMember, quitMember, registerGroupMembershipListener, stop, unregisterGroupMembershipListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGroupsMembershipService

public JGroupsMembershipService(java.net.URL jgroupsConfigFile)
                         throws ChannelException
Creates a new JGroupsMembershipService object

Parameters:
jgroupsConfigFile - JGroups configuration file
Method Detail

getJGroupsChannel

public org.jgroups.JChannel getJGroupsChannel()
Gets underlying JGroups channel.

Returns:
the JGroups channel

join

public Member join(ReliableGroupChannelWithGms channel,
                   GroupIdentifier gid)
            throws AlreadyMemberException,
                   NotConnectedException,
                   ChannelException
Description copied from class: GroupMembershipService
Joins the group that has the given group identifier.

Overrides:
join in class GroupMembershipService
Parameters:
channel - client channel to join the group
gid - the identifier of the group to join
Returns:
the Member corresponding to the newly joining member
Throws:
ChannelException - if an error is reported by the channel
NotConnectedException - if the channel is not connected
AlreadyMemberException - if we are already member of the group
See Also:
GroupMembershipService.join(org.objectweb.tribe.channel.ReliableGroupChannelWithGms, org.objectweb.tribe.common.GroupIdentifier)

quit

public void quit(ReliableGroupChannelWithGms channel,
                 GroupIdentifier gid)
          throws ChannelException,
                 NotConnectedException
Description copied from class: GroupMembershipService
Leaves the group that has the given group identifier.

Overrides:
quit in class GroupMembershipService
Parameters:
channel - client channel to leave the group
gid - the identifier of the group to quit
Throws:
NotConnectedException - if m does not belong to this group
ChannelException - if an error occurs
See Also:
GroupMembershipService.quit(org.objectweb.tribe.channel.ReliableGroupChannelWithGms, org.objectweb.tribe.common.GroupIdentifier)

memberFromJGroupsAddress

public static Member memberFromJGroupsAddress(org.jgroups.stack.IpAddress jgroupsAddress)
Returns a tribe Member object from a JGroups address (supposed to be an IpAddress).

Parameters:
jgroupsAddress - the JGroups address
Returns:
a tribe Member corresponding to this JGroups address

viewAccepted

public void viewAccepted(org.jgroups.View newView)
Specified by:
viewAccepted in interface org.jgroups.MembershipListener
See Also:
MembershipListener.viewAccepted(org.jgroups.View)

suspect

public void suspect(org.jgroups.Address suspectedMbr)
Specified by:
suspect in interface org.jgroups.MembershipListener
See Also:
MembershipListener.suspect(org.jgroups.Address)

block

public void block()
Specified by:
block in interface org.jgroups.MembershipListener
See Also:
MembershipListener.block()


Copyright © 2004 - ObjectWeb Consortium - All Rights Reserved.