public final class SingleResponseListener extends Object implements ClientHandler.ResponseListener
RPCResponse
message from the remote server.Constructor and Description |
---|
SingleResponseListener() |
Modifier and Type | Method and Description |
---|---|
RPCResponse |
get()
Waits to receive the response and returns the response message.
|
RPCResponse |
get(long timeout,
TimeUnit unit)
Waits to receive the response for at most a specified time, and returns the response message.
|
void |
onResponseReceived(RPCResponse response)
This method will be called when a message is received on the client.
|
public void onResponseReceived(RPCResponse response)
ClientHandler.ResponseListener
onResponseReceived
in interface ClientHandler.ResponseListener
response
- the RPC responsepublic RPCResponse get() throws ExecutionException, InterruptedException
RPCResponse
received from the remote serverExecutionException
- if the computation threw an exceptionInterruptedException
- if the current thread was interrupted while waitingpublic RPCResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
timeout
- the maximum amount of time to wait.unit
- the TimeUnit
of the timeout parameter.RPCResponse
received from the remote serverExecutionException
- if the computation threw an exceptionInterruptedException
- if the current thread was interrupted while waitingTimeoutException
- if the wait timed outCopyright © 2015. All Rights Reserved.