|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--JavaGroups.JavaStack.Protocol
|
+--JavaGroups.MessageDispatcher
Used on top of channel to implement group requests. Client's Handle()
method is called when request is received. Is the equivalent of RpcProtocol on the
application instead of protocol level.
| Constructor Summary | |
MessageDispatcher(Channel channel,
MessageListener l,
MembershipListener l2)
|
|
MessageDispatcher(Channel channel,
MessageListener l,
MembershipListener l2,
RequestHandler req_handler)
|
|
| 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)
An event is to be sent down the stack. |
void |
finalize()
|
java.lang.String |
GetName()
|
java.lang.Object |
Handle(Message msg)
|
void |
PassDown(Event evt)
Causes the event to be forwarded to the next layer down in the hierarchy.Typically called by the implementation of Down (when done). |
void |
PassUp(Event evt)
Called by request correlator when message was not generated by it. |
void |
Send(Message msg)
|
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 |
SetMembershipListener(MembershipListener l)
|
void |
SetMessageListener(MessageListener l)
|
void |
SetRequestHandler(RequestHandler rh)
|
void |
Start()
|
void |
StartDownHandler()
Used internally. |
void |
StartUpHandler()
Used internally. |
void |
Stop()
|
void |
StopInternal()
Used internally. |
void |
Up(Event evt)
Called by channel (we registered before) when event is received. |
| Methods inherited from class JavaGroups.JavaStack.Protocol |
GetDownProtocol,
GetProperties,
GetUpProtocol,
ProvidedDownServices,
ProvidedUpServices,
RequiredDownServices,
RequiredUpServices,
Reset,
SetDownProtocol,
SetProperties,
SetProtocolStack,
SetUpProtocol |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public MessageDispatcher(Channel channel,
MessageListener l,
MembershipListener l2)
public MessageDispatcher(Channel channel,
MessageListener l,
MembershipListener l2,
RequestHandler req_handler)
| Method Detail |
public void finalize()
public void Start()
public void Stop()
public void SetMessageListener(MessageListener l)
public void SetMembershipListener(MembershipListener l)
public void SetRequestHandler(RequestHandler rh)
public void Send(Message msg)
throws ChannelNotConnected,
ChannelClosed
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 to which then message is to be sent. If it is null, then the message
is sent to all membersmsg - 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 msg)
public java.lang.String GetName()
public void StartUpHandler()
public void StartDownHandler()
public void StopInternal()
public void PassUp(Event evt)
public void PassDown(Event evt)
Down (when done).public void Up(Event evt)
public void Down(Event evt)
PassDown. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using PassUp.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||