public interface RpcModule<S extends RpcRequest,T extends RpcResponse> extends RpcClient<S,T>
Modifier and Type | Method and Description |
---|---|
T |
createResponseWithException(Throwable ex)
Called when the
RpcModule throws an exception while executing a request. |
String |
getId()
Used to route the request/responses to the appropriate module.
|
String |
marshalRequest(S request)
Marshals the request to a string.
|
String |
marshalResponse(T response)
Marshals the response to a string.
|
S |
unmarshalRequest(String request)
Unmarshals the request from a string.
|
T |
unmarshalResponse(String response)
Unmarshals the response from a string.
|
String getId()
T createResponseWithException(Throwable ex)
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 © 2017. All rights reserved.