public static final class ClosingFuture.Peeker
extends java.lang.Object
ClosingFuture
s that are passed to ClosingFuture.whenAllComplete(Iterable)
or ClosingFuture.whenAllSucceed(Iterable)
.
Only for use by a ClosingFuture.Combiner.CombiningCallable
or ClosingFuture.Combiner.AsyncCombiningCallable
object.
Modifier and Type | Field and Description |
---|---|
private boolean |
beingCalled |
private ImmutableList<ClosingFuture<?>> |
futures |
Modifier | Constructor and Description |
---|---|
private |
Peeker(ImmutableList<ClosingFuture<?>> futures) |
Modifier and Type | Method and Description |
---|---|
private <V> V |
call(ClosingFuture.Combiner.CombiningCallable<V> combiner,
ClosingFuture.CloseableList closeables) |
private <V> FluentFuture<V> |
callAsync(ClosingFuture.Combiner.AsyncCombiningCallable<V> combiner,
ClosingFuture.CloseableList closeables) |
<D> D |
getDone(ClosingFuture<D> closingFuture)
Returns the value of
closingFuture . |
private final ImmutableList<ClosingFuture<?>> futures
private volatile boolean beingCalled
private Peeker(ImmutableList<ClosingFuture<?>> futures)
public final <D> D getDone(ClosingFuture<D> closingFuture) throws java.util.concurrent.ExecutionException
closingFuture
.java.util.concurrent.ExecutionException
- if closingFuture
is a failed stepjava.util.concurrent.CancellationException
- if the closingFuture
's future was cancelledjava.lang.IllegalArgumentException
- if closingFuture
is not one of the futures passed to
ClosingFuture.whenAllComplete(Iterable)
or ClosingFuture.whenAllComplete(Iterable)
java.lang.IllegalStateException
- if called outside of a call to CombiningCallable#call(DeferredCloser, Peeker)
or AsyncCombiningCallable#call(DeferredCloser, Peeker)
private <V> V call(ClosingFuture.Combiner.CombiningCallable<V> combiner, ClosingFuture.CloseableList closeables) throws java.lang.Exception
java.lang.Exception
private <V> FluentFuture<V> callAsync(ClosingFuture.Combiner.AsyncCombiningCallable<V> combiner, ClosingFuture.CloseableList closeables) throws java.lang.Exception
java.lang.Exception