public class RpcDispatcher extends MessageDispatcher
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 java.lang.Object |
server_obj |
async_dispatching, channel, channel_listeners, corr, hardware_multicast_supported, local_addr, log, members, membership_listener, msg_listener, prot_adapter, req_handler, rpc_stats, wrap_exceptions
Constructor and Description |
---|
RpcDispatcher() |
RpcDispatcher(Channel channel,
MessageListener l,
MembershipListener l2,
java.lang.Object server_obj) |
RpcDispatcher(Channel channel,
java.lang.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,
java.lang.String method_name,
java.lang.Object[] args,
java.lang.Class[] types,
RequestOptions options)
Invokes a method in a cluster member and - if blocking - returns the result
|
<T> RspList<T> |
callRemoteMethods(java.util.Collection<Address> dests,
MethodCall method_call,
RequestOptions options)
Invokes a method in all members and expects responses from members contained in dests (or all members if dests is null).
|
<T> RspList<T> |
callRemoteMethods(java.util.Collection<Address> dests,
java.lang.String method_name,
java.lang.Object[] args,
java.lang.Class[] types,
RequestOptions options)
Invokes a method in all members and expects responses from members contained in dests (or all members if dests is null).
|
<T> NotifyingFuture<RspList<T>> |
callRemoteMethodsWithFuture(java.util.Collection<Address> dests,
MethodCall method_call,
RequestOptions options)
Invokes a method in all members and expects responses from members contained in dests (or all members if dests is null).
|
<T> NotifyingFuture<RspList<T>> |
callRemoteMethodsWithFuture(java.util.Collection<Address> dests,
MethodCall method_call,
RequestOptions options,
FutureListener<RspList<T>> listener)
Invokes a method in all members and expects responses from 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
|
<T> NotifyingFuture<T> |
callRemoteMethodWithFuture(Address dest,
MethodCall call,
RequestOptions options,
FutureListener<T> listener)
Invokes a method in a cluster member and - if blocking - returns the result
|
protected void |
correlatorStarted() |
RpcDispatcher.Marshaller |
getMarshaller() |
MethodLookup |
getMethodLookup() |
static java.lang.String |
getName() |
RpcDispatcher.Marshaller |
getRequestMarshaller() |
RpcDispatcher.Marshaller |
getResponseMarshaller() |
java.lang.Object |
getServerObject() |
java.lang.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(java.lang.Object server_obj) |
addChannelListener, asyncDispatching, asyncDispatching, cast, cast, castMessage, castMessageWithFuture, castMessageWithFuture, channelClosed, channelConnected, channelDisconnected, close, correlator, correlator, createRequestCorrelator, done, extendedStats, extendedStats, getChannel, getMessageListener, getProtocolAdapter, handle, handleUpEvent, installUpHandler, removeChannelListener, rpcStats, sendMessage, sendMessageWithFuture, sendMessageWithFuture, setChannel, setMembers, setMembershipListener, setMessageListener, setRequestHandler, start, stop, wrapExceptions, wrapExceptions
protected java.lang.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, java.lang.Object server_obj)
public RpcDispatcher(Channel channel, java.lang.Object server_obj)
public static java.lang.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 java.lang.Object getServerObject()
public void setServerObject(java.lang.Object server_obj)
public MethodLookup getMethodLookup()
public void setMethodLookup(MethodLookup method_lookup)
public <T> RspList<T> callRemoteMethods(java.util.Collection<Address> dests, java.lang.String method_name, java.lang.Object[] args, java.lang.Class[] types, RequestOptions options) throws java.lang.Exception
dests
- A list of addresses. If null, we'll wait for responses from 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 etcjava.lang.Exception
- 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(java.util.Collection<Address> dests, MethodCall method_call, RequestOptions options) throws java.lang.Exception
dests
- A list of addresses. If null, we'll wait for responses from all cluster membersmethod_call
- The method (plus args) to be invokedoptions
- A collection of call options, e.g. sync versus async, timeout etcjava.lang.Exception
- 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(java.util.Collection<Address> dests, MethodCall method_call, RequestOptions options, FutureListener<RspList<T>> listener) throws java.lang.Exception
dests
- A list of addresses. If null, we'll wait for responses from all cluster membersmethod_call
- The method (plus args) to be invokedoptions
- A collection of call options, e.g. sync versus async, timeout etclistener
- A FutureListener which will be registered (if non null) with the future before the call is invokedjava.lang.Exception
- 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> NotifyingFuture<RspList<T>> callRemoteMethodsWithFuture(java.util.Collection<Address> dests, MethodCall method_call, RequestOptions options) throws java.lang.Exception
dests
- A list of addresses. If null, we'll wait for responses from all cluster membersmethod_call
- The method (plus args) to be invokedoptions
- A collection of call options, e.g. sync versus async, timeout etcjava.lang.Exception
- 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, java.lang.String method_name, java.lang.Object[] args, java.lang.Class[] types, RequestOptions options) throws java.lang.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)java.lang.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 java.lang.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)java.lang.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, FutureListener<T> listener) throws java.lang.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)listener
- A FutureListener which will be registered (if non null) with the future before the call is invokedjava.lang.Exception
- Thrown if the method invocation threw an exceptionpublic <T> NotifyingFuture<T> callRemoteMethodWithFuture(Address dest, MethodCall call, RequestOptions options) throws java.lang.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)java.lang.Exception
- Thrown if the method invocation threw an exceptionprotected void correlatorStarted()
correlatorStarted
in class MessageDispatcher
public java.lang.Object handle(Message req) throws java.lang.Exception
handle
in interface RequestHandler
handle
in class MessageDispatcher
java.lang.Exception
Copyright © 1998-2020 Red Hat. All Rights Reserved.