T - the type of this FutureS - the type of the adaptee's Futurepublic abstract class ListenableFutureAdapter<T,S> extends FutureAdapter<T,S> implements ListenableFuture<T>
ListenableFuture parameterized over S into a
ListenableFuture parameterized over T. All methods are delegated to the
adaptee, where FutureAdapter.get(), FutureAdapter.get(long, java.util.concurrent.TimeUnit), and
ListenableFutureCallback.onSuccess(Object) call FutureAdapter.adapt(Object) on the
adaptee's result.| Modifier | Constructor and Description |
|---|---|
protected |
ListenableFutureAdapter(ListenableFuture<S> adaptee)
Constructs a new
ListenableFutureAdapter with the given adaptee. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCallback(ListenableFutureCallback<? super T> callback)
Registers the given callback to this
ListenableFuture. |
adapt, cancel, get, get, getAdaptee, isCancelled, isDoneprotected ListenableFutureAdapter(ListenableFuture<S> adaptee)
ListenableFutureAdapter with the given adaptee.adaptee - the future to adaptee topublic void addCallback(ListenableFutureCallback<? super T> callback)
ListenableFutureListenableFuture. The callback will
be triggered when this Future is complete or, if it is already complete,
immediately.addCallback in interface ListenableFuture<T>callback - the callback to register