public class RpcDispatcher extends MessageDispatcher implements ChannelListener
Modifier and Type | Class and Description |
---|---|
static interface |
RpcDispatcher.Marshaller |
Modifier and Type | Field and Description |
---|---|
protected MethodLookup |
method_lookup |
protected RpcDispatcher.Marshaller |
req_marshaller
Marshaller to marshall requests at the caller and unmarshal requests at the receiver(s)
|
protected RpcDispatcher.Marshaller |
rsp_marshaller
Marshaller to marshal responses at the receiver(s) and unmarshal responses at the caller
|
protected Object |
server_obj |
channel, channel_listeners, corr, hardware_multicast_supported, local_addr, log, members, membership_listener, msg_listener, prot_adapter, req_handler
Constructor and Description |
---|
RpcDispatcher() |
RpcDispatcher(Channel channel,
MessageListener l,
MembershipListener l2,
Object server_obj) |
RpcDispatcher(Channel channel,
Object server_obj) |
Modifier and Type | Method and Description |
---|---|
<T> T |
callRemoteMethod(Address dest,
MethodCall call,
RequestOptions options)
Invokes a method in a cluster member and - if blocking - returns the result
|
<T> T |
callRemoteMethod(Address dest,
String method_name,
Object[] args,
Class[] types,
RequestOptions options)
Invokes a method in a cluster member and - if blocking - returns the result
|
<T> RspList<T> |
callRemoteMethods(Collection<Address> dests,
MethodCall method_call,
RequestOptions options)
Invokes a method in all members contained in dests (or all members if dests is null).
|
<T> RspList<T> |
callRemoteMethods(Collection<Address> dests,
String method_name,
Object[] args,
Class[] types,
RequestOptions options)
Invokes a method in all members contained in dests (or all members if dests is null).
|
<T> NotifyingFuture<RspList<T>> |
callRemoteMethodsWithFuture(Collection<Address> dests,
MethodCall method_call,
RequestOptions options)
Invokes a method in all members contained in dests (or all members if dests is null).
|
<T> NotifyingFuture<T> |
callRemoteMethodWithFuture(Address dest,
MethodCall call,
RequestOptions options)
Invokes a method in a cluster member and - if blocking - returns the result
|
protected void |
correlatorStarted() |
RpcDispatcher.Marshaller |
getMarshaller() |
MethodLookup |
getMethodLookup() |
static String |
getName() |
RpcDispatcher.Marshaller |
getRequestMarshaller() |
RpcDispatcher.Marshaller |
getResponseMarshaller() |
Object |
getServerObject() |
Object |
handle(Message req)
Message contains MethodCall.
|
void |
setMarshaller(RpcDispatcher.Marshaller m) |
void |
setMethodLookup(MethodLookup method_lookup) |
void |
setRequestMarshaller(RpcDispatcher.Marshaller m) |
void |
setResponseMarshaller(RpcDispatcher.Marshaller m) |
void |
setServerObject(Object server_obj) |
addChannelListener, cast, castMessage, castMessageWithFuture, channelClosed, channelConnected, channelDisconnected, createRequestCorrelator, done, getChannel, getMessageListener, getProtocolAdapter, installUpHandler, removeChannelListener, sendMessage, sendMessageWithFuture, setChannel, setMembers, setMembershipListener, setMessageListener, setRequestHandler, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
channelClosed, channelConnected, channelDisconnected
protected Object server_obj
protected RpcDispatcher.Marshaller req_marshaller
protected RpcDispatcher.Marshaller rsp_marshaller
protected MethodLookup method_lookup
public RpcDispatcher()
public RpcDispatcher(Channel channel, MessageListener l, MembershipListener l2, Object server_obj)
public static String getName()
public RpcDispatcher.Marshaller getRequestMarshaller()
public void setRequestMarshaller(RpcDispatcher.Marshaller m)
public RpcDispatcher.Marshaller getResponseMarshaller()
public void setResponseMarshaller(RpcDispatcher.Marshaller m)
public RpcDispatcher.Marshaller getMarshaller()
public void setMarshaller(RpcDispatcher.Marshaller m)
public Object getServerObject()
public void setServerObject(Object server_obj)
public MethodLookup getMethodLookup()
public void setMethodLookup(MethodLookup method_lookup)
public <T> RspList<T> callRemoteMethods(Collection<Address> dests, String method_name, Object[] args, Class[] types, RequestOptions options) throws Exception
dests
- dests A list of addresses. If null, the method will be invoked on all cluster membersmethod_name
- The name of the target methodargs
- The arguments to be passedtypes
- The types of the argumentsoptions
- A collection of call options, e.g. sync versus async, timeout etcException
- If the sending of the message threw an exception. Note that no exception will be
thrown if any of the target members threw an exception, but this exception will be in the Rsp
object for the particular member in the RspListpublic <T> RspList<T> callRemoteMethods(Collection<Address> dests, MethodCall method_call, RequestOptions options) throws Exception
dests
- A list of addresses. If null, the method will be invoked on all cluster membersmethod_call
- The method (plus args) to be invokedoptions
- A collection of call options, e.g. sync versus async, timeout etcException
- If the sending of the message threw an exception. Note that no exception will be
thrown if any of the target members threw an exception, but this exception will be in the Rsp
object for the particular member in the RspListpublic <T> NotifyingFuture<RspList<T>> callRemoteMethodsWithFuture(Collection<Address> dests, MethodCall method_call, RequestOptions options) throws Exception
dests
- A list of addresses. If null, the method will be invoked on all cluster membersmethod_call
- The method (plus args) to be invokedoptions
- A collection of call options, e.g. sync versus async, timeout etcException
- If the sending of the message threw an exception. Note that no exception will be
thrown if any of the target members threw an exception; such an exception will be in the Rsp
element for the particular member in the RspListpublic <T> T callRemoteMethod(Address dest, String method_name, Object[] args, Class[] types, RequestOptions options) throws Exception
dest
- The target member on which to invoke the methodmethod_name
- The name of the methodargs
- The argumentstypes
- The types of the argumentsoptions
- The options (e.g. blocking, timeout etc)Exception
- Thrown if the method invocation threw an exception, either at the caller or the calleepublic <T> T callRemoteMethod(Address dest, MethodCall call, RequestOptions options) throws Exception
dest
- The target member on which to invoke the methodcall
- The call to be invoked, including method are argumentsoptions
- The options (e.g. blocking, timeout etc)Exception
- Thrown if the method invocation threw an exception, either at the caller or the calleepublic <T> NotifyingFuture<T> callRemoteMethodWithFuture(Address dest, MethodCall call, RequestOptions options) throws Exception
dest
- The target member on which to invoke the methodcall
- The call to be invoked, including method are argumentsoptions
- The options (e.g. blocking, timeout etc)Exception
- Thrown if the method invocation threw an exceptionprotected void correlatorStarted()
correlatorStarted
in class MessageDispatcher
public Object handle(Message req) throws Exception
handle
in interface RequestHandler
handle
in class MessageDispatcher
Exception
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.