Class DefaultRPCInvocationContext
java.lang.Object
eu.cloudnetservice.driver.network.rpc.defaults.handler.DefaultRPCInvocationContext
- All Implemented Interfaces:
RPCInvocationContext
The default implementation of an RPC invocation context.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe default builder implementation for an RPC invocation context. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the data buffer slice which should contain the argument information for the current method invocation.Get the descriptor of the method that should be executed.Get the name of the method which should be invoked during the current rpc processing.Get the instance (if any) which should be considered first for a method invocation.
-
Field Details
-
methodName
-
methodDescriptor
-
argumentInformation
-
workingInstance
-
-
Constructor Details
-
DefaultRPCInvocationContext
private DefaultRPCInvocationContext(@NonNull @NonNull String methodName, @NonNull @NonNull String methodDescriptor, @NonNull @NonNull DataBuf argumentInformation, @Nullable @Nullable Object workingInstance) Constructs a new default RPC invocation context instance, only used by the builder.- Parameters:
methodName- the name of the method to invoke.methodDescriptor- the descriptor of the method to invoke.argumentInformation- the buffer containing the information about the arguments for the target method.workingInstance- the instance on which the method should be called, can be null.- Throws:
NullPointerException- if the given method name, descriptor or argument info is null.
-
-
Method Details
-
methodName
Get the name of the method which should be invoked during the current rpc processing.- Specified by:
methodNamein interfaceRPCInvocationContext- Returns:
- the name of the method which should be invoked.
-
methodDescriptor
Get the descriptor of the method that should be executed.- Specified by:
methodDescriptorin interfaceRPCInvocationContext- Returns:
- the descriptor of the method that should be executed.
-
argumentInformation
Get the data buffer slice which should contain the argument information for the current method invocation. The buffer can contain more, unrelated data.- Specified by:
argumentInformationin interfaceRPCInvocationContext- Returns:
- the data buffer which should contain the argument information for the current method invocation.
-
workingInstance
Get the instance (if any) which should be considered first for a method invocation. This is used for calling methods based on the result of the previous rpc in a chained rpc.- Specified by:
workingInstancein interfaceRPCInvocationContext- Returns:
- the instance to use for calling the requested method (if any).
-