Class AggregateFuture<InputT,OutputT>
- 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.AggregateFuture<InputT,OutputT>
-
- Type Parameters:
InputT- the type of the individual inputsOutputT- the type of the output (i.e. this) future
- All Implemented Interfaces:
AbstractFuture.Trusted<OutputT>,ListenableFuture<OutputT>,java.util.concurrent.Future<OutputT>
- Direct Known Subclasses:
CollectionFuture,CombinedFuture
@GwtCompatible abstract class AggregateFuture<InputT,OutputT> extends AbstractFuture.TrustedFuture<OutputT>
A future made up of a collection of sub-futures.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classAggregateFuture.RunningState-
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 static java.util.logging.Loggerloggerprivate AggregateFuture.RunningStaterunningState
-
Constructor Summary
Constructors Constructor Description AggregateFuture()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static booleanaddCausalChain(java.util.Set<java.lang.Throwable> seen, java.lang.Throwable t)Adds the chain to the seen set, and returns whether all the chain was new to us.protected voidafterDone()Callback method that is called exactly once after the future is completed.(package private) voidinit(AggregateFuture.RunningState runningState)Must be called at the end of each sub-class's constructor.protected java.lang.StringpendingToString()Provide a human-readable explanation of why this future has not yet completed.protected voidreleaseResources()-
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
-
logger
private static final java.util.logging.Logger logger
-
runningState
private AggregateFuture.RunningState runningState
-
-
Method Detail
-
afterDone
protected final void afterDone()
Description copied from class:AbstractFutureCallback method that is called exactly once after the future is completed.If
AbstractFuture.interruptTask()is also run during completion,AbstractFuture.afterDone()runs after it.The default implementation of this method in
AbstractFuturedoes nothing. This is intended for very lightweight cleanup work, for example, timing statistics or clearing fields. If your task does anything heavier consider, just using a listener with an executor.- Overrides:
afterDonein classAbstractFuture<OutputT>
-
releaseResources
protected final void releaseResources()
-
pendingToString
protected java.lang.String pendingToString()
Description copied from class:AbstractFutureProvide a human-readable explanation of why this future has not yet completed.- Overrides:
pendingToStringin classAbstractFuture<OutputT>- Returns:
- null if an explanation cannot be provided because the future is done.
-
init
final void init(AggregateFuture.RunningState runningState)
Must be called at the end of each sub-class's constructor.
-
addCausalChain
private static boolean addCausalChain(java.util.Set<java.lang.Throwable> seen, java.lang.Throwable t)Adds the chain to the seen set, and returns whether all the chain was new to us.
-
-