public class Call extends Object implements Future<JsonRpcResponse>, JsonRpcCall
Call
holds single response and uses BatchCall
as internal implementation to promote code reuse.Constructor and Description |
---|
Call(JsonRpcRequest req) |
Modifier and Type | Method and Description |
---|---|
void |
addResponse(JsonRpcResponse response) |
boolean |
cancel(boolean mayInterruptIfRunning) |
JsonRpcResponse |
get() |
JsonRpcResponse |
get(long timeout,
TimeUnit unit) |
org.codehaus.jackson.JsonNode |
getId() |
boolean |
isCancelled() |
boolean |
isDone() |
public Call(JsonRpcRequest req)
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface Future<JsonRpcResponse>
public void addResponse(JsonRpcResponse response)
addResponse
in interface JsonRpcCall
response
- Added to current call object.public org.codehaus.jackson.JsonNode getId()
public JsonRpcResponse get() throws InterruptedException, ExecutionException
get
in interface Future<JsonRpcResponse>
InterruptedException
ExecutionException
public JsonRpcResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<JsonRpcResponse>
InterruptedException
ExecutionException
TimeoutException
public boolean isCancelled()
isCancelled
in interface Future<JsonRpcResponse>
public boolean isDone()
isDone
in interface Future<JsonRpcResponse>
Copyright © 2016. All rights reserved.