Interface RPC
- All Superinterfaces:
ChainableRPC,RPCExecutable,RPCProvider
- All Known Implementing Classes:
DefaultRPC
The basic rpc class. A rpc holds all information about what should be called on the receiver site of the rpc and
which information (if any) should get sent back when the current rpc expects a result. Exceptions are handled during
the process and will be rethrown on the sender side rather than the receiver site.
The target method which should get called by the rpc is identified in 3 steps:
- Using the supplied target class of the rpc.
- Using the name of the method supplied to the rpc.
- Using the amount of arguments supplied to the rpc.
By default, if on all network components is the same version of a class available there is no way a method can not be identified by rpc as the creation of a sender based on a class with unclear methods will instantly result in an exception to prevent exceptions during the runtime.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionGet the arguments which should get used to call the method.Get the fully qualified name of the class the target method is located in.Disables that this rpc is waiting for a result from the target network component.Get the expected result type of the method invocation.booleanGet if this rpc expects a result from the network component the invoke request is sent to.Get the name of the method which should get called.sender()Get the sender from which the rpc call is coming (better known as the base class in which the method to call by this rpc is located in).Methods inherited from interface eu.cloudnetservice.driver.network.rpc.ChainableRPC
joinMethods inherited from interface eu.cloudnetservice.driver.network.rpc.RPCExecutable
fire, fire, fireAndForget, fireAndForget, fireSync, fireSyncMethods inherited from interface eu.cloudnetservice.driver.network.rpc.RPCProvider
dataBufFactory, objectMapper, targetClass
-
Method Details
-
sender
Get the sender from which the rpc call is coming (better known as the base class in which the method to call by this rpc is located in).- Returns:
- the sender of this rpc.
-
className
Get the fully qualified name of the class the target method is located in.- Returns:
- the fully qualified name of the class the target method is located in.
-
methodName
Get the name of the method which should get called.- Returns:
- the name of the method which should get called.
-
arguments
Get the arguments which should get used to call the method. The main identification of a method happens based on the name and the amount of arguments supplied. Invalid arguments might cause exceptions on the receiver site.- Returns:
- the arguments which should get used to call the method.
-
expectedResultType
Get the expected result type of the method invocation. Can be void.- Returns:
- the expected result type of the method invocation.
-
disableResultExpectation
Disables that this rpc is waiting for a result from the target network component. By default, the current component will always wait for the target method to be executed on the receiver site, event if the method returns void.- Returns:
- the same instance used to call the method, for chaining.
-
expectsResult
boolean expectsResult()Get if this rpc expects a result from the network component the invoke request is sent to.- Returns:
- true if the current rpc expects a result from the target network component, false otherwise.
-