Class CombinedFuture.CombinedFutureRunningState
- java.lang.Object
-
- com.google.common.util.concurrent.AggregateFutureState
-
- com.google.common.util.concurrent.AggregateFuture.RunningState
-
- com.google.common.util.concurrent.CombinedFuture.CombinedFutureRunningState
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- CombinedFuture<V>
private final class CombinedFuture.CombinedFutureRunningState extends AggregateFuture.RunningState
-
-
Field Summary
Fields Modifier and Type Field Description private CombinedFuture.CombinedFutureInterruptibleTasktask
-
Constructor Summary
Constructors Constructor Description CombinedFutureRunningState(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, CombinedFuture.CombinedFutureInterruptibleTask task)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcollectOneValue(boolean allMustSucceed, int index, java.lang.Object returnValue)Called only ifcollectsValuesis true.(package private) voidhandleAllCompleted()(package private) voidinterruptTask()(package private) voidreleaseResourcesAfterFailure()Listeners implicitly keep a reference toAggregateFuture.RunningStateas they're inner classes, so we free resources here as well for the allMustSucceed=true case (i.e.-
Methods inherited from class com.google.common.util.concurrent.AggregateFuture.RunningState
addInitialException, run
-
Methods inherited from class com.google.common.util.concurrent.AggregateFutureState
decrementRemainingAndGet, getOrInitSeenExceptions
-
-
-
-
Field Detail
-
task
private CombinedFuture.CombinedFutureInterruptibleTask task
-
-
Constructor Detail
-
CombinedFutureRunningState
CombinedFutureRunningState(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, CombinedFuture.CombinedFutureInterruptibleTask task)
-
-
Method Detail
-
collectOneValue
void collectOneValue(boolean allMustSucceed, int index, java.lang.Object returnValue)Description copied from class:AggregateFuture.RunningStateCalled only ifcollectsValuesis true.If
allMustSucceedis true, called as each future completes; otherwise, called for each future when all futures complete.- Specified by:
collectOneValuein classAggregateFuture.RunningState
-
handleAllCompleted
void handleAllCompleted()
- Specified by:
handleAllCompletedin classAggregateFuture.RunningState
-
releaseResourcesAfterFailure
void releaseResourcesAfterFailure()
Description copied from class:AggregateFuture.RunningStateListeners implicitly keep a reference toAggregateFuture.RunningStateas they're inner classes, so we free resources here as well for the allMustSucceed=true case (i.e. when a future fails, we immediately release resources we no longer need); additionally, the future will release its reference toAggregateFuture.RunningState, which should free all associated memory when all the futures complete and the listeners are released.TODO(user): Write tests for memory retention
- Overrides:
releaseResourcesAfterFailurein classAggregateFuture.RunningState
-
interruptTask
void interruptTask()
- Overrides:
interruptTaskin classAggregateFuture.RunningState
-
-