Interface RPCSender
- All Superinterfaces:
RPCProvider
- All Known Implementing Classes:
DefaultRPCSender
A sender which can send rpc requests to another network component.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionGet the network component associated with this rpc sender.factory()Get the provider factory used to construct this rpc sender.invokeMethod(@NonNull String methodName) Creates a rpc to invoke the target method with no arguments, preventing a new object array allocation each time the method is invoked.invokeMethod(@NonNull String methodName, Object... args) Creates a rpc to invoke the target method with the given arguments.Methods inherited from interface eu.cloudnetservice.driver.network.rpc.RPCProvider
dataBufFactory, objectMapper, targetClass
-
Method Details
-
factory
Get the provider factory used to construct this rpc sender.- Returns:
- the provider factory used to construct this rpc sender.
-
associatedComponent
Get the network component associated with this rpc sender.- Returns:
- the network component associated with this rpc sender.
- Throws:
UnsupportedOperationException- if this sender has no network component associated.
-
invokeMethod
Creates a rpc to invoke the target method with no arguments, preventing a new object array allocation each time the method is invoked. Equivalent tosender.invokeMethod(name, new Object[0]).- Parameters:
methodName- the name of the method to invoke.- Returns:
- the rpc usable to fire the rpc request against the given method.
- Throws:
NullPointerException- if the given method name is null.CannotDecideException- if either none or multiple methods are matching the given method name.
-
invokeMethod
Creates a rpc to invoke the target method with the given arguments. For this operation to succeed, the class must- contain a method which equals the given method name (case sensitive)
- that method must have the amount of arguments supplied via the arguments array.
- Parameters:
methodName- the name of the method to invoke.args- the arguments to use for the method invocation.- Returns:
- the rpc usable to fire the rpc request against the given method.
- Throws:
NullPointerException- if the given method name is null.CannotDecideException- if either none or multiple methods are matching the given method name.
-