jgroup.relacs.gmi.protocols
Class Multicast

java.lang.Object
  extended by jgroup.relacs.gmi.protocols.BasicDispatcher
      extended by jgroup.relacs.gmi.protocols.Multicast
All Implemented Interfaces:
MulticastListener, ProtocolDispatcher

public class Multicast
extends BasicDispatcher
implements MulticastListener

Multicast represents a protocol that dispatch method invocations received through the local endpoint to all the other members of the group, including the local server. The result from all members is returned to the local endpoint whom first received the method invocation request, and one of them is selected and passed back to the client.

Author:
Hein Meling

Constructor Summary
Multicast(GroupInvocationDispatcher dispatcher, MulticastService mcast, MembershipService pgms)
           
 
Method Summary
 java.lang.Object deliverObject(java.lang.Object msg, MemberId sender, int seqNo)
          Upcall that is invoked by Jgroup to deliver a message msg, corresponding to a single serialized object.
 java.lang.Object deliverStream(java.io.InputStream msg, MemberId sender, int seqNo)
          Received a multicast message from a mediating endpoint for invocation dispatching at the local server.
 InvocationResult dispatch(java.io.InputStream in)
          Handle inbound request to the local endpoint with multicast invocation semantics.
 java.lang.String getProtocolName()
          Returns a string naming the protocol implemented by this multicast listener.
 
Methods inherited from class jgroup.relacs.gmi.protocols.BasicDispatcher
getIdentifier, setServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Multicast

public Multicast(GroupInvocationDispatcher dispatcher,
                 MulticastService mcast,
                 MembershipService pgms)
Method Detail

dispatch

public InvocationResult dispatch(java.io.InputStream in)
                          throws java.io.IOException
Handle inbound request to the local endpoint with multicast invocation semantics. The local endpoint will send a multicast message to all the other group members for method invocation dispatching at each members. They each return a result to the local endpoint, and one of these values are selected and returned to the client (GroupInvocationHandler).

Specified by:
dispatch in interface ProtocolDispatcher
Overrides:
dispatch in class BasicDispatcher
Parameters:
in - the method to invoke, encoded in the provided InputStream.
Returns:
the result of the method invocation.
Throws:
java.io.IOException - Raised if the method invocation read from the InputStream could not be executed for some reason.
See Also:
ProtocolDispatcher.dispatch(java.io.InputStream)

getProtocolName

public java.lang.String getProtocolName()
Description copied from interface: MulticastListener
Returns a string naming the protocol implemented by this multicast listener.

Specified by:
getProtocolName in interface MulticastListener

deliverStream

public java.lang.Object deliverStream(java.io.InputStream msg,
                                      MemberId sender,
                                      int seqNo)
Received a multicast message from a mediating endpoint for invocation dispatching at the local server.

Specified by:
deliverStream in interface MulticastListener
Parameters:
msg - Multicast message received
sender - the sender of the multicast message
seqNo - the sequence number of this multicast message
Returns:
The result of the multicast invocation, or null if the invocation failed.
See Also:
MulticastListener.deliverStream(java.io.InputStream, jgroup.core.MemberId, int)

deliverObject

public java.lang.Object deliverObject(java.lang.Object msg,
                                      MemberId sender,
                                      int seqNo)
Description copied from interface: MulticastListener
Upcall that is invoked by Jgroup to deliver a message msg, corresponding to a single serialized object.

Specified by:
deliverObject in interface MulticastListener
Parameters:
msg - the object that was multicasted.
sender - the sender of the multicast message
seqNo - the sequence number of this multicast message
Returns:
an object that will be delivered to the invoker through the AckListener object specified when multicasting the message.


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.