final class CombinedFuture<V> extends AggregateFuture<java.lang.Object,V>
Modifier and Type | Class and Description |
---|---|
private class |
CombinedFuture.AsyncCallableInterruptibleTask |
private class |
CombinedFuture.CallableInterruptibleTask |
private class |
CombinedFuture.CombinedFutureInterruptibleTask<T> |
AggregateFuture.ReleaseResourcesReason
AbstractFuture.Trusted<V>, AbstractFuture.TrustedFuture<V>
Modifier and Type | Field and Description |
---|---|
private CombinedFuture.CombinedFutureInterruptibleTask<?> |
task |
Constructor and Description |
---|
CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures,
boolean allMustSucceed,
java.util.concurrent.Executor listenerExecutor,
AsyncCallable<V> callable) |
CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures,
boolean allMustSucceed,
java.util.concurrent.Executor listenerExecutor,
java.util.concurrent.Callable<V> callable) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
collectOneValue(int index,
java.lang.Object returnValue)
If
allMustSucceed is true, called as each future completes; otherwise, if collectsValues is true, called for each future when all futures complete. |
(package private) void |
handleAllCompleted() |
protected void |
interruptTask()
Subclasses can override this method to implement interruption of the future's computation.
|
(package private) void |
releaseResources(AggregateFuture.ReleaseResourcesReason reason)
Clears fields that are no longer needed after this future has completed -- or at least all its
inputs have completed (more precisely, after
AggregateFuture.handleAllCompleted() has been called). |
addInitialException, afterDone, init, pendingToString
clearSeenExceptions, decrementRemainingAndGet, getOrInitSeenExceptions
addListener, cancel, get, get, isCancelled, isDone
maybePropagateCancellationTo, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
private CombinedFuture.CombinedFutureInterruptibleTask<?> task
CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, java.util.concurrent.Executor listenerExecutor, AsyncCallable<V> callable)
CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, java.util.concurrent.Executor listenerExecutor, java.util.concurrent.Callable<V> callable)
void collectOneValue(int index, java.lang.Object returnValue)
AggregateFuture
allMustSucceed
is true, called as each future completes; otherwise, if collectsValues
is true, called for each future when all futures complete.collectOneValue
in class AggregateFuture<java.lang.Object,V>
void handleAllCompleted()
handleAllCompleted
in class AggregateFuture<java.lang.Object,V>
void releaseResources(AggregateFuture.ReleaseResourcesReason reason)
AggregateFuture
AggregateFuture.handleAllCompleted()
has been called).
Often called multiple times (that is, both when the inputs complete and when the output
completes).
This is similar to our proposed afterCommit
method but not quite the same. See the
description of CL 265462958.
releaseResources
in class AggregateFuture<java.lang.Object,V>
protected void interruptTask()
AbstractFuture
cancel(true)
.
The default implementation does nothing.
This method is likely to be deprecated. Prefer to override AbstractFuture.afterDone()
, checking
AbstractFuture.wasInterrupted()
to decide whether to interrupt your task.
interruptTask
in class AbstractFuture<V>