Class DefaultRPCProvider
java.lang.Object
eu.cloudnetservice.driver.network.rpc.defaults.DefaultRPCProvider
- All Implemented Interfaces:
RPCProvider
- Direct Known Subclasses:
DefaultRPC,DefaultRPCChain,DefaultRPCHandler,DefaultRPCSender
An abstract implementation of a rpc provider for easier implementation in subclasses.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DataBufFactoryprotected final ObjectMapperprotected final Class<?> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultRPCProvider(@NonNull Class<?> targetClass, @NonNull ObjectMapper objectMapper, @NonNull DataBufFactory dataBufFactory) Constructs a new default rpc provider instance. -
Method Summary
Modifier and TypeMethodDescriptionGet the data buf factory which is used to allocate network data buffers if needed.Get the object mapper which is used for (de-) serialization of objects if needed.Get the class which is targeted by the associated rpc.
-
Field Details
-
targetClass
-
objectMapper
-
dataBufFactory
-
-
Constructor Details
-
DefaultRPCProvider
protected DefaultRPCProvider(@NonNull @NonNull Class<?> targetClass, @NonNull @NonNull ObjectMapper objectMapper, @NonNull @NonNull DataBufFactory dataBufFactory) Constructs a new default rpc provider instance.- Parameters:
targetClass- the target class of method calls handled by this provider.objectMapper- the object mapper to use to write and read data from the buffers.dataBufFactory- the buffer factory used for buffer allocations.- Throws:
NullPointerException- if the given class, object mapper or data buf factory is null.
-
-
Method Details
-
targetClass
Get the class which is targeted by the associated rpc.- Specified by:
targetClassin interfaceRPCProvider- Returns:
- the target class.
-
objectMapper
Get the object mapper which is used for (de-) serialization of objects if needed.- Specified by:
objectMapperin interfaceRPCProvider- Returns:
- the associated object mapper.
-
dataBufFactory
Get the data buf factory which is used to allocate network data buffers if needed.- Specified by:
dataBufFactoryin interfaceRPCProvider- Returns:
- the associated data buf factory.
-