Class AggregateFuture<InputT,OutputT>
- java.lang.Object
-
- com.google.common.util.concurrent.GwtFluentFutureCatchingSpecialization<V>
-
- com.google.common.util.concurrent.FluentFuture<V>
-
- 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:
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) class
AggregateFuture.RunningState
-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.AbstractFuture
AbstractFuture.TrustedFuture<V>
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
private AggregateFuture.RunningState
runningState
-
Constructor Summary
Constructors Constructor Description AggregateFuture()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected void
afterDone()
Callback method that is called exactly once after the future is completed.(package private) void
init(AggregateFuture.RunningState runningState)
Must be called at the end of each sub-class's constructor.protected java.lang.String
pendingToString()
Provide a human-readable explanation of why this future has not yet completed.-
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, trustedGetException, wasInterrupted
-
Methods inherited from class com.google.common.util.concurrent.FluentFuture
addCallback, catching, catchingAsync, from, transform, transformAsync, withTimeout
-
-
-
-
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:AbstractFuture
Callback 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
AbstractFuture
does 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:
afterDone
in classAbstractFuture<OutputT>
-
pendingToString
protected java.lang.String pendingToString()
Description copied from class:AbstractFuture
Provide a human-readable explanation of why this future has not yet completed.- Overrides:
pendingToString
in 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.
-
-