|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.tribe.adapters.MulticastRequestAdapter
This class defines a MulticastRequestAdapter which is similar to JGroups MessageDispatcher. It is a sort of multicast RPC (Remote Procedure Call) where a message is multicasted and each member return a response.
Field Summary | |
static int |
WAIT_ALL
Wait for all responses before returning of a multicast send |
static int |
WAIT_FIRST
Wait for the first reponse before returning of a multicast send |
static int |
WAIT_MAJORITY
Wait for a majority of responses before returning of a multicast send |
static int |
WAIT_NONE
Do not wait for any response when multicasting a message (asynchronous) |
Constructor Summary | |
MulticastRequestAdapter(ReliableGroupChannel channel,
MessageListener msgListener,
MulticastRequestListener dispatcherListener)
Creates a new MulticastRequestAdapter object |
Method Summary | |
ReliableGroupChannel |
getChannel()
Returns the channel value. |
MulticastResponse |
multicastMessage(java.util.ArrayList dests,
java.io.Serializable msg,
int waitMode,
long timeout)
Multicast a message to the given list of member. |
void |
receive(java.io.Serializable msg)
Callback when a message is received. |
void |
stop()
Stop this MulticastRequestAdapter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int WAIT_NONE
public static final int WAIT_FIRST
public static final int WAIT_MAJORITY
public static final int WAIT_ALL
Constructor Detail |
public MulticastRequestAdapter(ReliableGroupChannel channel, MessageListener msgListener, MulticastRequestListener dispatcherListener)
MulticastRequestAdapter
object
Method Detail |
public ReliableGroupChannel getChannel()
public void stop()
public void receive(java.io.Serializable msg)
MessageListener
receive
in interface MessageListener
msg
- Message received.MessageListener.receive(java.io.Serializable)
public MulticastResponse multicastMessage(java.util.ArrayList dests, java.io.Serializable msg, int waitMode, long timeout) throws TimeoutException, ChannelException, NotConnectedException
dests
- members to send the message to1msg
- message to sendwaitMode
- one of WAIT_NONE, WAIT_FIRST, WAIT_MAJORITY or WAIT_ALLtimeout
- time in ms to wait for responses (0 means no timeout)
TimeoutException
- if the timeout expires
NotConnectedException
- if the underlying channel is not connected to
a group
ChannelException
- if an error occurs during transmission
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |