Interface RPCSender
- All Superinterfaces:
RPCProvider
A sender which can send rpc requests to another network component.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder for an RPC sender which can be obtained from an RPC factory. -
Method Summary
Modifier and TypeMethodDescriptioninvokeCaller(Object... args) Returns a new RPC that can invoke the calling method with the provided arguments.invokeCallerWithOffset(int callerStackOffset, Object... args) Returns a new RPC that can invoke the calling method with the provided arguments.invokeMethod(@NonNull String methodName, @NonNull TypeDescriptor methodDesc, Object... args) Returns a new RPC that can invoke the method with the given name and descriptor.invokeMethod(@NonNull String methodName, Object... args) Tries to resolve a distinct method with the given name and argument count in the target class and returns a new RPC that can invoke the resolved method with the provided arguments.Methods inherited from interface RPCProvider
dataBufFactory, objectMapper, sourceFactory, targetClass
-
Method Details
-
invokeCaller
Returns a new RPC that can invoke the calling method with the provided arguments.- Parameters:
args- the arguments to supply when invoking the method.- Returns:
- an RPC that calls the caller method on a remote component with the provided arguments.
- Throws:
IllegalStateException- if the calling method cannot be resolved.IllegalArgumentException- if the calling method is not known in the target class.
-
invokeCallerWithOffset
Returns a new RPC that can invoke the calling method with the provided arguments.- Parameters:
callerStackOffset- the offset on the stack where the target method is located.args- the arguments to supply when invoking the method.- Returns:
- an RPC that calls the caller method on a remote component with the provided arguments.
- Throws:
IllegalStateException- if the calling method cannot be resolved.IllegalArgumentException- if the calling method is not known in the target class.
-
invokeMethod
Tries to resolve a distinct method with the given name and argument count in the target class and returns a new RPC that can invoke the resolved method with the provided arguments.- Parameters:
methodName- the name of the method to invoke.args- the arguments to supply when invoking the method.- Returns:
- an RPC to invoke the resolved method with the given name and parameter count on the remote.
- Throws:
NullPointerException- if the given method name or arguments array is null.IllegalArgumentException- if the method to call cannot be resolved in the target class.
-
invokeMethod
@NonNull @NonNull RPC invokeMethod(@NonNull @NonNull String methodName, @NonNull @NonNull TypeDescriptor methodDesc, Object... args) Returns a new RPC that can invoke the method with the given name and descriptor.- Parameters:
methodName- the name of the method to invoke.methodDesc- the descriptor of the method to invoke.args- the arguments to supply for the method invocation.- Returns:
- an RPC to invoke the resolved method with the given parameters on a remote.
- Throws:
NullPointerException- if the given method name, method descriptor or argument array is null.IllegalArgumentException- if the method to call cannot be resolved in the target class.
-