Class CollectionFuture<V,C>
- java.lang.Object
-
- com.google.common.util.concurrent.internal.InternalFutureFailureAccess
-
- com.google.common.util.concurrent.AbstractFuture<V>
-
- com.google.common.util.concurrent.AbstractFuture.TrustedFuture<OutputT>
-
- com.google.common.util.concurrent.AggregateFutureState<OutputT>
-
- com.google.common.util.concurrent.AggregateFuture<V,C>
-
- com.google.common.util.concurrent.CollectionFuture<V,C>
-
- All Implemented Interfaces:
AbstractFuture.Trusted<C>,ListenableFuture<C>,java.util.concurrent.Future<C>
- Direct Known Subclasses:
CollectionFuture.ListFuture
abstract class CollectionFuture<V,C> extends AggregateFuture<V,C>
Aggregate future that collects (stores) results of each future.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classCollectionFuture.ListFuture<V>private static classCollectionFuture.Present<V>The result of a successfulFuture.-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.AggregateFuture
AggregateFuture.ReleaseResourcesReason
-
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 java.util.List<CollectionFuture.Present<V>>values
-
Constructor Summary
Constructors Constructor Description CollectionFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) voidcollectOneValue(int index, V returnValue)IfallMustSucceedis true, called as each future completes; otherwise, ifcollectsValuesis true, called for each future when all futures complete.(package private) abstract Ccombine(java.util.List<CollectionFuture.Present<V>> values)(package private) voidhandleAllCompleted()(package private) voidreleaseResources(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, afterAggregateFuture.handleAllCompleted()has been called).-
Methods inherited from class com.google.common.util.concurrent.AggregateFuture
addInitialException, afterDone, init, pendingToString
-
Methods inherited from class com.google.common.util.concurrent.AggregateFutureState
clearSeenExceptions, decrementRemainingAndGet, getOrInitSeenExceptions
-
Methods inherited from class com.google.common.util.concurrent.AbstractFuture.TrustedFuture
addListener, cancel, get, get, isCancelled, isDone
-
Methods inherited from class com.google.common.util.concurrent.AbstractFuture
interruptTask, maybePropagateCancellationTo, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
-
-
-
-
Field Detail
-
values
private java.util.List<CollectionFuture.Present<V>> values
-
-
Constructor Detail
-
CollectionFuture
CollectionFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed)
-
-
Method Detail
-
collectOneValue
final void collectOneValue(int index, V returnValue)Description copied from class:AggregateFutureIfallMustSucceedis true, called as each future completes; otherwise, ifcollectsValuesis true, called for each future when all futures complete.- Specified by:
collectOneValuein classAggregateFuture<V,C>
-
handleAllCompleted
final void handleAllCompleted()
- Specified by:
handleAllCompletedin classAggregateFuture<V,C>
-
releaseResources
void releaseResources(AggregateFuture.ReleaseResourcesReason reason)
Description copied from class:AggregateFutureClears fields that are no longer needed after this future has completed -- or at least all its inputs have completed (more precisely, afterAggregateFuture.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
afterCommitmethod but not quite the same. See the description of CL 265462958.- Overrides:
releaseResourcesin classAggregateFuture<V,C>
-
combine
abstract C combine(java.util.List<CollectionFuture.Present<V>> values)
-
-