public abstract class FutureClientResponseListener<T> extends FutureTask<T> implements FutureListener<ClientResponse>
Constructor and Description |
---|
FutureClientResponseListener() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
protected abstract T |
get(ClientResponse response) |
boolean |
isCancelled() |
void |
onComplete(Future<ClientResponse> response)
Invoked when a Future has reached the completed termination state.
|
void |
setCancelableFuture(Future<ClientResponse> f) |
done, get, get, isDone, run, runAndReset, set, setException
public void setCancelableFuture(Future<ClientResponse> f)
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<T>
isCancelled
in class FutureTask<T>
public void onComplete(Future<ClientResponse> response)
FutureListener
The catching of a ExecutionException
when
Future.get
is invoked may be utilized to determine if the
future terminated with an exception. The exception can be obtained
by invoking Throwable.getCause()
.
The catching of a CancellationException
when
Future.get
is invoked may be utilized to determine if the
future terminated with a cancellation.
onComplete
in interface FutureListener<ClientResponse>
response
- the completed Future. Invocation of Future.isDone()
will return true. Since the future is complete invocation of
Future.get()
and Future.get(long, java.util.concurrent.TimeUnit)
will not result in the throwing of an InterruptedException
.protected abstract T get(ClientResponse response)
Copyright © 2013 Oracle Corporation. All rights reserved.