Interface GatewayRpcImplementation
public interface GatewayRpcImplementation
This interface is used to provide the Gateway with the necessary information to handle RPC calls.
Your
GatewayModuleHook should return an
instance of this to opt in to RPC functionality for your module. The Gateway will then
automatically use the provided serializer and router to handle incoming RPC calls if they match
your module ID.
Recommended practice is to use the of() factory method to construct an instance that uses an RpcDelegate to
handle RPC calls.
For example:
class MyModuleHook extends AbstractGatewayModuleHook {
@Override
public Optional<GatewayRpcImplementation> getRpcImplementation() {
return Optional.of(
GatewayRpcImplementation.of(ProtoRpcSerializer.DEFAULT_INSTANCE, new MyModuleRpcImpl())
);
}
}
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionnewBuilder(GatewayRpcSerializer defaultSerializer) static GatewayRpcImplementationof(GatewayRpcSerializer serializer, Object... interfaces) Constructs a GatewayRpcImplementation from the provided serializer and interfaces.
-
Method Details
-
getSerializer
GatewayRpcSerializer getSerializer() -
getRpcRouter
RpcRouter getRpcRouter() -
of
Constructs a GatewayRpcImplementation from the provided serializer and interfaces. Each interface implementation provided must be annotated withRpcInterface.- See Also:
-
newBuilder
-