private static class Futures.CombinedFuture<V,C> extends AbstractFuture<C>
AbstractFuture.Sync<V>| Modifier and Type | Field and Description |
|---|---|
(package private) boolean |
allMustSucceed |
(package private) Futures.FutureCombiner<V,C> |
combiner |
(package private) ImmutableCollection<? extends ListenableFuture<? extends V>> |
futures |
private static java.util.logging.Logger |
logger |
(package private) java.util.concurrent.atomic.AtomicInteger |
remaining |
(package private) java.util.Set<java.lang.Throwable> |
seenExceptions |
(package private) java.lang.Object |
seenExceptionsLock |
(package private) java.util.List<Optional<V>> |
values |
| Constructor and Description |
|---|
CombinedFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
boolean allMustSucceed,
java.util.concurrent.Executor listenerExecutor,
Futures.FutureCombiner<V,C> combiner) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
init(java.util.concurrent.Executor listenerExecutor)
Must be called at the end of the constructor.
|
private void |
setExceptionAndMaybeLog(java.lang.Throwable throwable)
Fails this future with the given Throwable if
allMustSucceed is
true. |
private void |
setOneValue(int index,
java.util.concurrent.Future<? extends V> future)
Sets the value at the given index to that of the given future.
|
addListener, cancel, cancellationExceptionWithCause, get, get, interruptTask, isCancelled, isDone, set, setException, wasInterruptedprivate static final java.util.logging.Logger logger
ImmutableCollection<? extends ListenableFuture<? extends V>> futures
final boolean allMustSucceed
final java.util.concurrent.atomic.AtomicInteger remaining
Futures.FutureCombiner<V,C> combiner
final java.lang.Object seenExceptionsLock
java.util.Set<java.lang.Throwable> seenExceptions
CombinedFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed, java.util.concurrent.Executor listenerExecutor, Futures.FutureCombiner<V,C> combiner)
protected void init(java.util.concurrent.Executor listenerExecutor)
private void setExceptionAndMaybeLog(java.lang.Throwable throwable)
allMustSucceed is
true. Also, logs the throwable if it is an Error or if
allMustSucceed is true, the throwable did not cause
this future to fail, and it is the first time we've seen that particular Throwable.private void setOneValue(int index,
java.util.concurrent.Future<? extends V> future)