public class EchoRpcModule extends AbstractXmlRpcModule<EchoRequest,EchoResponse>
Modifier and Type | Field and Description |
---|---|
static EchoRpcModule |
INSTANCE |
static String |
RPC_MODULE_ID |
Constructor and Description |
---|
EchoRpcModule() |
Modifier and Type | Method and Description |
---|---|
void |
beforeRun() |
EchoResponse |
createResponseWithException(Throwable ex)
Called when the
RpcModule throws an exception while executing a request. |
CompletableFuture<EchoResponse> |
execute(EchoRequest request) |
String |
getId()
Used to route the request/responses to the appropriate module.
|
void |
processRequest(EchoRequest request,
CompletableFuture<EchoResponse> future) |
marshalRequest, marshalResponse, unmarshalRequest, unmarshalResponse
public static final EchoRpcModule INSTANCE
public static final String RPC_MODULE_ID
public void beforeRun()
public CompletableFuture<EchoResponse> execute(EchoRequest request)
public void processRequest(EchoRequest request, CompletableFuture<EchoResponse> future)
public String getId()
RpcModule
public EchoResponse createResponseWithException(Throwable ex)
RpcModule
RpcModule
throws an exception while executing a request.
This function should return a new RpcResponse
that stores a string-based representation
of the exception that occurred and make this available via RpcResponse.getErrorMessage()
once un-marshaled.ex
- the exception that occurredRpcResponse
that stores the exceptionCopyright © 2020. All rights reserved.