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.CombinedFutureInterruptibleTask
task
-
Constructor Summary
Constructors Constructor Description CombinedFutureRunningState(ImmutableCollection<? extends ListenableFuture<? extends java.lang.Object>> futures, boolean allMustSucceed, CombinedFuture.CombinedFutureInterruptibleTask task)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
collectOneValue(boolean allMustSucceed, int index, java.lang.Object returnValue)
Called only ifcollectsValues
is true.(package private) void
handleAllCompleted()
(package private) void
interruptTask()
(package private) void
releaseResourcesAfterFailure()
Listeners implicitly keep a reference toAggregateFuture.RunningState
as 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<? extends java.lang.Object>> futures, boolean allMustSucceed, CombinedFuture.CombinedFutureInterruptibleTask task)
-
-
Method Detail
-
collectOneValue
void collectOneValue(boolean allMustSucceed, int index, @Nullable java.lang.Object returnValue)
Description copied from class:AggregateFuture.RunningState
Called only ifcollectsValues
is true.If
allMustSucceed
is true, called as each future completes; otherwise, called for each future when all futures complete.- Specified by:
collectOneValue
in classAggregateFuture.RunningState
-
handleAllCompleted
void handleAllCompleted()
- Specified by:
handleAllCompleted
in classAggregateFuture.RunningState
-
releaseResourcesAfterFailure
void releaseResourcesAfterFailure()
Description copied from class:AggregateFuture.RunningState
Listeners implicitly keep a reference toAggregateFuture.RunningState
as 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:
releaseResourcesAfterFailure
in classAggregateFuture.RunningState
-
interruptTask
void interruptTask()
- Overrides:
interruptTask
in classAggregateFuture.RunningState
-
-