org.objectweb.tribe.channel
Class JGroupsReliableChannelWithGms

java.lang.Object
  extended byorg.objectweb.tribe.channel.ReliableGroupChannel
      extended byorg.objectweb.tribe.channel.ReliableGroupChannelWithGms
          extended byorg.objectweb.tribe.channel.JGroupsReliableChannelWithGms

public class JGroupsReliableChannelWithGms
extends ReliableGroupChannelWithGms

This class defines a JGroupsReliableChannelWithGms which is a ReliableGroupChannelWithGms wrapper on top of a JGroups JChannel that uses the GMS service provided by JGroups.

Version:
1.0
Author:
Emmanuel Cecchet

Field Summary
 
Fields inherited from class org.objectweb.tribe.channel.ReliableGroupChannelWithGms
gms
 
Fields inherited from class org.objectweb.tribe.channel.ReliableGroupChannel
channelPool, currentGroup, incomingBuffer, me
 
Constructor Summary
JGroupsReliableChannelWithGms(JGroupsMembershipService gms)
          Creates a new JGroupsReliableChannel object
 
Method Summary
 Group getCurrentGroup()
          Returns the current group we are connected to or null if we are not connected to any group.
 Member getLocalMembership()
          Returns the local membership value (Member object representing this channel in the group).
 java.lang.String getProperties()
          Return the JGroups channel properties
 void join(Group g)
          Join the group that has the given group identifier.
 void quit()
          Quit the current group.
 java.io.Serializable receive()
          Receives a new message from the channel.
 java.util.ArrayList send(java.io.Serializable msg, GroupIdentifier gid, java.util.ArrayList members)
          Sends a message to members of group gid without being necessary member of the group.
 java.lang.String toString()
           
 
Methods inherited from class org.objectweb.tribe.channel.ReliableGroupChannelWithGms
getGroup, join
 
Methods inherited from class org.objectweb.tribe.channel.ReliableGroupChannel
close, send, send, setMembership
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JGroupsReliableChannelWithGms

public JGroupsReliableChannelWithGms(JGroupsMembershipService gms)
Creates a new JGroupsReliableChannel object

Parameters:
gms - the GMS service to use
Method Detail

join

public void join(Group g)
          throws AlreadyMemberException,
                 ChannelException,
                 NotConnectedException
Description copied from class: ReliableGroupChannel
Join the group that has the given group identifier.

Overrides:
join in class ReliableGroupChannel
Throws:
AlreadyMemberException - if we are already member of the group
NotConnectedException - if the channel is not connected
ChannelException - if an error is reported by the channel
See Also:
ReliableGroupChannel.join(org.objectweb.tribe.common.Group)

quit

public void quit()
          throws ChannelException,
                 NotConnectedException
Description copied from class: ReliableGroupChannelWithGms
Quit the current group.

Overrides:
quit in class ReliableGroupChannelWithGms
Throws:
ChannelException - if a communication error occurs
NotConnectedException - if the channel is not connected to any group
See Also:
ReliableGroupChannel.quit()

receive

public java.io.Serializable receive()
                             throws ChannelException,
                                    NotConnectedException
Description copied from class: ReliableGroupChannel
Receives a new message from the channel.

Overrides:
receive in class ReliableGroupChannel
Returns:
the new message
Throws:
ChannelException - if an error occurs
NotConnectedException - if the channel is not connected to any group
See Also:
ReliableGroupChannel.receive()

send

public java.util.ArrayList send(java.io.Serializable msg,
                                GroupIdentifier gid,
                                java.util.ArrayList members)
                         throws ChannelException,
                                NotConnectedException
Description copied from class: ReliableGroupChannelWithGms
Sends a message to members of group gid without being necessary member of the group.

Overrides:
send in class ReliableGroupChannelWithGms
Parameters:
msg - message to send
members - ArrayList of Member that are all part of the group
Returns:
an ArrayList of Members who failed, or null if all members received successfully the message.
Throws:
ChannelException - if an error occurs
NotConnectedException - if the channel is not connected to any group
See Also:
ReliableGroupChannel.send(java.io.Serializable, org.objectweb.tribe.common.GroupIdentifier, java.util.ArrayList)

toString

public java.lang.String toString()
See Also:
Object.toString()

getProperties

public java.lang.String getProperties()
Return the JGroups channel properties

Returns:
JGroups channel properties

getLocalMembership

public Member getLocalMembership()
Description copied from class: ReliableGroupChannel
Returns the local membership value (Member object representing this channel in the group).

Overrides:
getLocalMembership in class ReliableGroupChannel
Returns:
Returns the local membership (me).
See Also:
ReliableGroupChannel.getLocalMembership()

getCurrentGroup

public Group getCurrentGroup()
Description copied from class: ReliableGroupChannel
Returns the current group we are connected to or null if we are not connected to any group.

Overrides:
getCurrentGroup in class ReliableGroupChannel
Returns:
Returns the current group or null.
See Also:
ReliableGroupChannel.getCurrentGroup()


Copyright © 2004 - ObjectWeb Consortium - All Rights Reserved.