Class Futures.InCompletionOrderFuture<T>
- java.lang.Object
-
- com.google.common.util.concurrent.internal.InternalFutureFailureAccess
-
- com.google.common.util.concurrent.AbstractFuture<T>
-
- com.google.common.util.concurrent.Futures.InCompletionOrderFuture<T>
-
- All Implemented Interfaces:
ListenableFuture<T>,java.util.concurrent.Future<T>
- Enclosing class:
- Futures
private static final class Futures.InCompletionOrderFuture<T> extends AbstractFuture<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.AbstractFuture
AbstractFuture.Trusted<V>, AbstractFuture.TrustedFuture<V>
-
-
Field Summary
Fields Modifier and Type Field Description private Futures.InCompletionOrderState<T>state
-
Constructor Summary
Constructors Modifier Constructor Description privateInCompletionOrderFuture(Futures.InCompletionOrderState<T> state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterDone()Callback method that is called exactly once after the future is completed.booleancancel(boolean interruptIfRunning)protected java.lang.StringpendingToString()Provide a human-readable explanation of why this future has not yet completed.-
Methods inherited from class com.google.common.util.concurrent.AbstractFuture
addListener, get, get, interruptTask, isCancelled, isDone, maybePropagateCancellationTo, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
-
-
-
-
Field Detail
-
state
private Futures.InCompletionOrderState<T> state
-
-
Constructor Detail
-
InCompletionOrderFuture
private InCompletionOrderFuture(Futures.InCompletionOrderState<T> state)
-
-
Method Detail
-
cancel
public boolean cancel(boolean interruptIfRunning)
Description copied from class:AbstractFutureIf a cancellation attempt succeeds on a
Futurethat had previously been set asynchronously, then the cancellation will also be propagated to the delegateFuturethat was supplied in thesetFuturecall.Rather than override this method to perform additional cancellation work or cleanup, subclasses should override
AbstractFuture.afterDone(), consultingAbstractFuture.isCancelled()andAbstractFuture.wasInterrupted()as necessary. This ensures that the work is done even if the future is cancelled without a call tocancel, such as by callingsetFuture(cancelledFuture).Beware of completing a future while holding a lock. Its listeners may do slow work or acquire other locks, risking deadlocks.
- Specified by:
cancelin interfacejava.util.concurrent.Future<T>- Overrides:
cancelin classAbstractFuture<T>
-
afterDone
protected void afterDone()
Description copied from class:AbstractFutureCallback method that is called exactly once after the future is completed.If
AbstractFuture.interruptTask()is also run during completion,AbstractFuture.afterDone()runs after it.The default implementation of this method in
AbstractFuturedoes nothing. This is intended for very lightweight cleanup work, for example, timing statistics or clearing fields. If your task does anything heavier consider, just using a listener with an executor.- Overrides:
afterDonein classAbstractFuture<T>
-
pendingToString
protected java.lang.String pendingToString()
Description copied from class:AbstractFutureProvide a human-readable explanation of why this future has not yet completed.- Overrides:
pendingToStringin classAbstractFuture<T>- Returns:
- null if an explanation cannot be provided (e.g. because the future is done).
-
-