|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--JavaGroups.JavaStack.Protocol
|
+--JavaGroups.JavaStack.MessageProtocol
Based on Protocol, but incorporates RequestCorrelator and GroupRequest: the latter can be used to mcast messages to all members and receive their reponses.
A protocol based on this template can send messages to all members and receive all, a single,
n, or none responses. Requests directed towards the protocol can be handled by overriding
method Handle.
Requests and responses are in the form of Messages, which would typically need to
contain information pertaining to the request/response, e.g. in the form of objects contained
in the message. To use remote method calls, use RpcProtocol instead.
Typical use of of a MessageProtocol would be when a protocol needs to interact with
its peer protocols at each of the members' protocol stacks. A simple protocol like fragmentation,
which does not need to interact with other instances of fragmentation, may simply subclass
Protocol instead.
| Constructor Summary | |
MessageProtocol()
|
|
| Method Summary | |
RspList |
CastMessage(java.util.Vector dests,
Message msg,
int mode,
long timeout)
Cast a message to all members, and wait for mode responses. |
void |
Down(Event evt)
This message is not originated by this layer, therefore we can just pass it down without having to go through the request correlator. |
java.lang.Object |
Handle(Message req)
Processes a request destined for this layer. |
java.lang.Object |
SendMessage(Message msg,
int mode,
long timeout)
Sends a message to a single member (destination = msg.dest) and returns the response. |
void |
Up(Event evt)
An event was received from the layer below. |
| Methods inherited from class JavaGroups.JavaStack.Protocol |
GetDownProtocol,
GetName,
GetProperties,
GetUpProtocol,
PassDown,
PassUp,
ProvidedDownServices,
ProvidedUpServices,
RequiredDownServices,
RequiredUpServices,
Reset,
SetDownProtocol,
SetProperties,
SetProtocolStack,
SetUpProtocol,
StartDownHandler,
StartUpHandler,
StopInternal |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public MessageProtocol()
| Method Detail |
public RspList CastMessage(java.util.Vector dests,
Message msg,
int mode,
long timeout)
mode responses. The responses are
returned in a response list, where each response is associated with its sender.
Uses GroupRequest.
dests - The members from which responses are expected. If it is null, replies from all members
are expected. The request itself is multicast to all members.msg - The message to be sent to n membersmode - Defined in GroupRequest. The number of responses to wait for:
timeout - If 0: wait forever. Otherwise, wait for mode responses
or timeout time.Object and associated
to its sender.
public java.lang.Object SendMessage(Message msg,
int mode,
long timeout)
throws Timeout,
Suspected
public java.lang.Object Handle(Message req)
public final void Up(Event evt)
PassDown or c) the event (or another event) is sent up
the stack using PassUp.public final void Down(Event evt)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||