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.Object
An object that can return the value of theClosingFuture
s that are passed toClosingFuture.whenAllComplete(Iterable)
orClosingFuture.whenAllSucceed(Iterable)
.Only for use by a
ClosingFuture.Combiner.CombiningCallable
orClosingFuture.Combiner.AsyncCombiningCallable
object.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
beingCalled
private ImmutableList<ClosingFuture<?>>
futures
-
Constructor Summary
Constructors Modifier Constructor Description private
Peeker(ImmutableList<ClosingFuture<?>> futures)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 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
- ifclosingFuture
is a failed stepjava.util.concurrent.CancellationException
- if theclosingFuture
's future was cancelledjava.lang.IllegalArgumentException
- ifclosingFuture
is 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
-
-