JavaGroups
Class RpcDispatcher
java.lang.Object
|
+--JavaGroups.JavaStack.Protocol
|
+--JavaGroups.MessageDispatcher
|
+--JavaGroups.RpcDispatcher
- public class RpcDispatcher
- extends MessageDispatcher
- implements ChannelListener
Dispatches and receives remote group method calls. Is the equivalent of RpcProtocol
on the application rather than protocol level.
|
Method Summary |
java.lang.Object |
CallRemoteMethod(java.lang.Object dest,
MethodCall method_call,
int mode,
long timeout)
|
java.lang.Object |
CallRemoteMethod(java.lang.Object dest,
java.lang.String method_name,
int mode,
long timeout)
|
java.lang.Object |
CallRemoteMethod(java.lang.Object dest,
java.lang.String method_name,
java.lang.Object arg1,
int mode,
long timeout)
|
java.lang.Object |
CallRemoteMethod(java.lang.Object dest,
java.lang.String method_name,
java.lang.Object arg1,
java.lang.Object arg2,
int mode,
long timeout)
|
java.lang.Object |
CallRemoteMethod(java.lang.Object dest,
java.lang.String method_name,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
int mode,
long timeout)
|
RspList |
CallRemoteMethods(java.util.Vector dests,
MethodCall method_call,
int mode,
long timeout)
|
RspList |
CallRemoteMethods(java.util.Vector dests,
java.lang.String method_name,
int mode,
long timeout)
|
RspList |
CallRemoteMethods(java.util.Vector dests,
java.lang.String method_name,
java.lang.Object arg1,
int mode,
long timeout)
|
RspList |
CallRemoteMethods(java.util.Vector dests,
java.lang.String method_name,
java.lang.Object arg1,
java.lang.Object arg2,
int mode,
long timeout)
|
RspList |
CallRemoteMethods(java.util.Vector dests,
java.lang.String method_name,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
int mode,
long timeout)
|
RspList |
CastMessage(java.util.Vector dests,
Message msg,
int mode,
long timeout)
Cast a message to all members, and wait for mode responses. |
void |
ChannelClosed(Channel channel)
|
void |
ChannelConnected(Channel channel)
|
void |
ChannelDisconnected(Channel channel)
|
java.lang.String |
GetName()
|
java.lang.Object |
Handle(Message req)
Message contains MethodCall. |
java.lang.Object |
SendMessage(Message msg,
int mode,
long timeout)
Sends a message to a single member (destination = msg.dest) and returns the response. |
| Methods inherited from class JavaGroups.MessageDispatcher |
Down,
finalize,
PassDown,
PassUp,
Send,
SetMembershipListener,
SetMessageListener,
SetRequestHandler,
Start,
StartDownHandler,
StartUpHandler,
Stop,
StopInternal,
Up |
| 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 |
RpcDispatcher
public RpcDispatcher(Channel channel,
MessageListener l,
MembershipListener l2,
java.lang.Object server_obj)
GetName
public java.lang.String GetName()
- Overrides:
- GetName in class MessageDispatcher
CastMessage
public RspList CastMessage(java.util.Vector dests,
Message msg,
int mode,
long timeout)
- Description copied from class: MessageDispatcher
- Cast a message to all members, and wait for
mode responses. The responses are
returned in a response list, where each response is associated with its sender.
Uses GroupRequest.
- Overrides:
- CastMessage in class MessageDispatcher
- Tags copied from class: MessageDispatcher
- Parameters:
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:
- GET_FIRST: return the first response received.
- GET_ALL: wait for all responses (minus the ones from suspected members)
- GET_MAJORITY: wait for a majority of all responses (relative to the grp size)
- GET_ABS_MAJORITY: wait for majority (absolute, computed once)
- GET_N: wait for n responses (may block if n > group size)
- GET_NONE: wait for no responses, return immediately (non-blocking)
timeout - If 0: wait forever. Otherwise, wait for mode responses
or timeout time.- Returns:
- RspList A list of responses. Each response is an
Object and associated
to its sender.
SendMessage
public java.lang.Object SendMessage(Message msg,
int mode,
long timeout)
throws Timeout,
Suspected
- Description copied from class: MessageDispatcher
- Sends a message to a single member (destination = msg.dest) and returns the response.
The message's destination must be non-zero !
- Overrides:
- SendMessage in class MessageDispatcher
CallRemoteMethods
public RspList CallRemoteMethods(java.util.Vector dests,
java.lang.String method_name,
int mode,
long timeout)
CallRemoteMethods
public RspList CallRemoteMethods(java.util.Vector dests,
java.lang.String method_name,
java.lang.Object arg1,
int mode,
long timeout)
CallRemoteMethods
public RspList CallRemoteMethods(java.util.Vector dests,
java.lang.String method_name,
java.lang.Object arg1,
java.lang.Object arg2,
int mode,
long timeout)
CallRemoteMethods
public RspList CallRemoteMethods(java.util.Vector dests,
java.lang.String method_name,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
int mode,
long timeout)
CallRemoteMethods
public RspList CallRemoteMethods(java.util.Vector dests,
MethodCall method_call,
int mode,
long timeout)
CallRemoteMethod
public java.lang.Object CallRemoteMethod(java.lang.Object dest,
java.lang.String method_name,
int mode,
long timeout)
throws Timeout,
Suspected
CallRemoteMethod
public java.lang.Object CallRemoteMethod(java.lang.Object dest,
java.lang.String method_name,
java.lang.Object arg1,
int mode,
long timeout)
throws Timeout,
Suspected
CallRemoteMethod
public java.lang.Object CallRemoteMethod(java.lang.Object dest,
java.lang.String method_name,
java.lang.Object arg1,
java.lang.Object arg2,
int mode,
long timeout)
throws Timeout,
Suspected
CallRemoteMethod
public java.lang.Object CallRemoteMethod(java.lang.Object dest,
java.lang.String method_name,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
int mode,
long timeout)
throws Timeout,
Suspected
CallRemoteMethod
public java.lang.Object CallRemoteMethod(java.lang.Object dest,
MethodCall method_call,
int mode,
long timeout)
throws Timeout,
Suspected
Handle
public java.lang.Object Handle(Message req)
- Message contains MethodCall. Execute it against *this* object and return result.
Use MethodCall.Invoke() to do this. Return result.
- Overrides:
- Handle in class MessageDispatcher
ChannelConnected
public void ChannelConnected(Channel channel)
- Specified by:
- ChannelConnected in interface ChannelListener
ChannelDisconnected
public void ChannelDisconnected(Channel channel)
- Specified by:
- ChannelDisconnected in interface ChannelListener
ChannelClosed
public void ChannelClosed(Channel channel)
- Specified by:
- ChannelClosed in interface ChannelListener