Class ClosingFuture.Peeker
- java.lang.Object
-
- com.google.common.util.concurrent.ClosingFuture.Peeker
-
- Enclosing class:
- ClosingFuture<V>
public static final class ClosingFuture.Peeker extends java.lang.ObjectAn object that can return the value of theClosingFutures that are passed toClosingFuture.whenAllComplete(Iterable)orClosingFuture.whenAllSucceed(Iterable).Only for use by a
ClosingFuture.Combiner.CombiningCallableorClosingFuture.Combiner.AsyncCombiningCallableobject.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanbeingCalledprivate ImmutableList<ClosingFuture<?>>futures
-
Constructor Summary
Constructors Modifier Constructor Description privatePeeker(ImmutableList<ClosingFuture<?>> futures)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private <V> Vcall(ClosingFuture.Combiner.CombiningCallable<V> combiner, ClosingFuture.CloseableList closeables)private <V> FluentFuture<V>callAsync(ClosingFuture.Combiner.AsyncCombiningCallable<V> combiner, ClosingFuture.CloseableList closeables)<D> DgetDone(ClosingFuture<D> closingFuture)Returns the value ofclosingFuture.
-
-
-
Field Detail
-
futures
private final ImmutableList<ClosingFuture<?>> futures
-
beingCalled
private volatile boolean beingCalled
-
-
Constructor Detail
-
Peeker
private Peeker(ImmutableList<ClosingFuture<?>> futures)
-
-
Method Detail
-
getDone
public final <D> D getDone(ClosingFuture<D> closingFuture) throws java.util.concurrent.ExecutionException
Returns the value ofclosingFuture.- Throws:
java.util.concurrent.ExecutionException- ifclosingFutureis a failed stepjava.util.concurrent.CancellationException- if theclosingFuture's future was cancelledjava.lang.IllegalArgumentException- ifclosingFutureis not one of the futures passed toClosingFuture.whenAllComplete(Iterable)orClosingFuture.whenAllComplete(Iterable)java.lang.IllegalStateException- if called outside of a call toClosingFuture.Combiner.CombiningCallable.call(DeferredCloser, Peeker)orClosingFuture.Combiner.AsyncCombiningCallable.call(DeferredCloser, Peeker)
-
call
private <V> V call(ClosingFuture.Combiner.CombiningCallable<V> combiner, ClosingFuture.CloseableList closeables) throws java.lang.Exception
- Throws:
java.lang.Exception
-
callAsync
private <V> FluentFuture<V> callAsync(ClosingFuture.Combiner.AsyncCombiningCallable<V> combiner, ClosingFuture.CloseableList closeables) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-