RunnableFuture that also implements the ListenableFuture interface.
This should be used in preference to ListenableFutureTask when possible for
performance reasons.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private volatile InterruptibleTask |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | afterDone()
Overrides com. |
| pack-priv static <V extends @Nullable Object> TrustedListenableFutureTask | |
| pack-priv static <V extends @Nullable Object> TrustedListenableFutureTask | |
| pack-priv static <V extends @Nullable Object> TrustedListenableFutureTask | create(Runnable
the runnable task runnable, V the result to return on successful completion. If you don't need a particular
result, consider using constructions of the form: result)ListenableFuture<?> f =
ListenableFutureTask.create(runnable, null)Creates a |
| protected String | pendingToString()
Overrides com. |
| public void | run()
Implements java. |
| task | back to summary |
|---|---|
| private volatile InterruptibleTask<?> task
| |
| TrustedListenableFutureTask | back to summary |
|---|---|
| pack-priv TrustedListenableFutureTask(Callable<V> callable) | |
| TrustedListenableFutureTask | back to summary |
|---|---|
| pack-priv TrustedListenableFutureTask(AsyncCallable<V> callable) | |
| afterDone | back to summary |
|---|---|
| protected void afterDone() Overrides com. Doc from com. Callback method that is called exactly once after the future is completed. If The default implementation of this method in
| |
| create | back to summary |
|---|---|
| pack-priv static <V extends @Nullable Object> TrustedListenableFutureTask | |
| create | back to summary |
|---|---|
| pack-priv static <V extends @Nullable Object> TrustedListenableFutureTask | |
| create | back to summary |
|---|---|
| pack-priv static <V extends @Nullable Object> TrustedListenableFutureTask Creates a
| |
| pendingToString | back to summary |
|---|---|
| protected String pendingToString() Overrides com. Doc from com. Provide a human-readable explanation of why this future has not yet completed.
| |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Sets this Future to the result of its computation unless it has been cancelled.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final AsyncCallable |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | afterRanInterruptiblyFailure(Throwable error)
Implements abstract com. |
| pack-priv void | afterRanInterruptiblySuccess(ListenableFuture<V> result)
Implements abstract com. |
| pack-priv final boolean | isDone()
Implements abstract com. |
| pack-priv ListenableFuture | runInterruptibly()
Implements abstract com. |
| pack-priv String | toPendingString()
Implements abstract com. |
| callable | back to summary |
|---|---|
| private final AsyncCallable<V> callable | |
| TrustedFutureInterruptibleAsyncTask | back to summary |
|---|---|
| pack-priv TrustedFutureInterruptibleAsyncTask(AsyncCallable<V> callable) | |
| afterRanInterruptiblyFailure | back to summary |
|---|---|
| pack-priv void afterRanInterruptiblyFailure(Throwable error) Implements abstract com. Doc from com. Any interruption that happens as a result of calling interruptTask will arrive before this method is called. Complete Futures here.
| |
| afterRanInterruptiblySuccess | back to summary |
|---|---|
| pack-priv void afterRanInterruptiblySuccess(ListenableFuture<V> result) Implements abstract com. Doc from com. Any interruption that happens as a result of calling interruptTask will arrive before this method is called. Complete Futures here.
| |
| isDone | back to summary |
|---|---|
| pack-priv final boolean isDone() Implements abstract com. Doc from com. Called before runInterruptibly - if true, runInterruptibly and afterRanInterruptibly will not be called.
| |
| runInterruptibly | back to summary |
|---|---|
| pack-priv ListenableFuture Implements abstract com. Doc from com. Do interruptible work here - do not complete Futures here, as their listeners could be interrupted.
| |
| toPendingString | back to summary |
|---|---|
| pack-priv String toPendingString() Implements abstract com.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | afterRanInterruptiblyFailure(Throwable error)
Implements abstract com. |
| pack-priv void | afterRanInterruptiblySuccess(V result)
Implements abstract com. |
| pack-priv final boolean | isDone()
Implements abstract com. |
| pack-priv V | runInterruptibly()
Implements abstract com. |
| pack-priv String | toPendingString()
Implements abstract com. |
| callable | back to summary |
|---|---|
| private final Callable<V> callable | |
| TrustedFutureInterruptibleTask | back to summary |
|---|---|
| pack-priv TrustedFutureInterruptibleTask(Callable<V> callable) | |
| afterRanInterruptiblyFailure | back to summary |
|---|---|
| pack-priv void afterRanInterruptiblyFailure(Throwable error) Implements abstract com. Doc from com. Any interruption that happens as a result of calling interruptTask will arrive before this method is called. Complete Futures here.
| |
| afterRanInterruptiblySuccess | back to summary |
|---|---|
| pack-priv void afterRanInterruptiblySuccess(V result) Implements abstract com. Doc from com. Any interruption that happens as a result of calling interruptTask will arrive before this method is called. Complete Futures here.
| |
| isDone | back to summary |
|---|---|
| pack-priv final boolean isDone() Implements abstract com. Doc from com. Called before runInterruptibly - if true, runInterruptibly and afterRanInterruptibly will not be called.
| |
| runInterruptibly | back to summary |
|---|---|
| pack-priv V runInterruptibly() throws Exception Implements abstract com. Doc from com. Do interruptible work here - do not complete Futures here, as their listeners could be interrupted.
| |
| toPendingString | back to summary |
|---|---|
| pack-priv String toPendingString() Implements abstract com.
| |