public class ApacheResponseFuture<V> extends AbstractListenableFuture<V>
Constructor and Description |
---|
ApacheResponseFuture(AsyncHandler<V> asyncHandler,
int responseTimeoutInMs,
Request request,
org.apache.commons.httpclient.HttpMethodBase method) |
Modifier and Type | Method and Description |
---|---|
void |
abort(Throwable t)
|
boolean |
cancel(boolean mayInterruptIfRunning) |
void |
content(V v)
TODO.
|
void |
done()
Terminate and if there is no exception, mark this Future as done and release the internal lock.
|
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
Request |
getRequest() |
boolean |
hasExpired()
Is the Future still valid
|
boolean |
isCancelled() |
boolean |
isDone() |
protected void |
setInnerFuture(Future<V> innerFuture) |
protected void |
setReaperFuture(Future<?> reaperFuture) |
String |
toString() |
void |
touch()
Touch the current instance to prevent external service to times out.
|
addListener, runListeners
public ApacheResponseFuture(AsyncHandler<V> asyncHandler, int responseTimeoutInMs, Request request, org.apache.commons.httpclient.HttpMethodBase method)
public void done()
ListenableFuture
public void content(V v)
v
- The new contentprotected void setReaperFuture(Future<?> reaperFuture)
public void abort(Throwable t)
ListenableFuture
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
public boolean isDone()
public V get() throws InterruptedException, ExecutionException
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
public boolean hasExpired()
true
if response has expired and should be terminated.public void touch()
ListenableFuture
public Request getRequest()
Copyright © 2014. All Rights Reserved.