Class AggregateFutureState<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.AggregateFutureState<OutputT>
-
- All Implemented Interfaces:
AbstractFuture.Trusted<OutputT>
,ListenableFuture<OutputT>
,java.util.concurrent.Future<OutputT>
- Direct Known Subclasses:
AggregateFuture
abstract class AggregateFutureState<OutputT> extends AbstractFuture.TrustedFuture<OutputT>
A helper which does some thread-safe operations for aggregate futures, which must be implemented differently in GWT. Namely:- Lazily initializes a set of seen exceptions
- Decrements a counter atomically
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AggregateFutureState.AtomicHelper
private static class
AggregateFutureState.SafeAtomicHelper
private static class
AggregateFutureState.SynchronizedAtomicHelper
-
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 AggregateFutureState.AtomicHelper
ATOMIC_HELPER
private static java.util.logging.Logger
log
private int
remaining
private java.util.Set<java.lang.Throwable>
seenExceptions
-
Constructor Summary
Constructors Constructor Description AggregateFutureState(int remainingFutures)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract void
addInitialException(java.util.Set<java.lang.Throwable> seen)
Populatesseen
with the exception that was passed tosetException
.(package private) void
clearSeenExceptions()
(package private) int
decrementRemainingAndGet()
(package private) java.util.Set<java.lang.Throwable>
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
afterDone, interruptTask, maybePropagateCancellationTo, pendingToString, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
-
-
-
-
Field Detail
-
seenExceptions
@CheckForNull private volatile java.util.Set<java.lang.Throwable> seenExceptions
-
remaining
private volatile int remaining
-
ATOMIC_HELPER
private static final AggregateFutureState.AtomicHelper ATOMIC_HELPER
-
log
private static final java.util.logging.Logger log
-
-
Method Detail
-
getOrInitSeenExceptions
final java.util.Set<java.lang.Throwable> getOrInitSeenExceptions()
-
addInitialException
abstract void addInitialException(java.util.Set<java.lang.Throwable> seen)
Populatesseen
with the exception that was passed tosetException
.
-
decrementRemainingAndGet
final int decrementRemainingAndGet()
-
clearSeenExceptions
final void clearSeenExceptions()
-
-