Top Description Inners Fields Constructors Methods
com.google.common.util.concurrent

pack-priv final Class CombinedFuture<V extends @Nullable Object>

extends AggregateFuture<@Nullable Object, V extends @Nullable Object>
Class Inheritance
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkNotNull, com.google.common.util.concurrent.AggregateFuture.ReleaseResourcesReason.OUTPUT_FUTURE_DONE

Aggregate future that computes its value by calling a callable.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
private abstract class

Field Summary

Modifier and TypeField and Description
private CombinedFuture<V>.CombinedFutureInterruptibleTask<?>

Constructor Summary

AccessConstructor and Description
pack-priv
CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, Executor listenerExecutor, AsyncCallable<V> callable)

pack-priv
CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, Executor listenerExecutor, Callable<V> callable)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
collectOneValue(int index, Object returnValue)

Implements abstract com.google.common.util.concurrent.AggregateFuture.collectOneValue.

If allMustSucceed is true, called as each future completes; otherwise, if collectsValues is true, called for each future when all futures complete.
pack-priv void
protected void
interruptTask()

Overrides com.google.common.util.concurrent.AbstractFuture.interruptTask.

Subclasses can override this method to implement interruption of the future's computation.
pack-priv void
releaseResources(AggregateFuture.ReleaseResourcesReason reason)

Overrides com.google.common.util.concurrent.AggregateFuture.releaseResources.

Clears fields that are no longer needed after this future has completed -- or at least all its inputs have completed (more precisely, after handleAllCompleted() has been called).
Inherited from com.google.common.util.concurrent.AggregateFuture:
addInitialExceptionafterDoneinitpendingToString

Field Detail

taskback to summary
private CombinedFuture<V>.CombinedFutureInterruptibleTask<?> task
Annotations
@CheckForNull
@LazyInit

Constructor Detail

CombinedFutureback to summary
pack-priv CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, Executor listenerExecutor, AsyncCallable<V> callable)
CombinedFutureback to summary
pack-priv CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, Executor listenerExecutor, Callable<V> callable)

Method Detail

collectOneValueback to summary
pack-priv void collectOneValue(int index, Object returnValue)

Implements abstract com.google.common.util.concurrent.AggregateFuture.collectOneValue.

Doc from com.google.common.util.concurrent.AggregateFuture.collectOneValue.

If allMustSucceed is true, called as each future completes; otherwise, if collectsValues is true, called for each future when all futures complete.

Annotations
@Override
handleAllCompletedback to summary
pack-priv void handleAllCompleted()

Implements abstract com.google.common.util.concurrent.AggregateFuture.handleAllCompleted.

Annotations
@Override
interruptTaskback to summary
protected void interruptTask()

Overrides com.google.common.util.concurrent.AbstractFuture.interruptTask.

Doc from com.google.common.util.concurrent.AbstractFuture.interruptTask.

Subclasses can override this method to implement interruption of the future's computation. The method is invoked automatically by a successful call to cancel(true).

The default implementation does nothing.

This method is likely to be deprecated. Prefer to override afterDone, checking wasInterrupted to decide whether to interrupt your task.

Annotations
@Override
releaseResourcesback to summary
pack-priv void releaseResources(AggregateFuture.ReleaseResourcesReason reason)

Overrides com.google.common.util.concurrent.AggregateFuture.releaseResources.

Doc from com.google.common.util.concurrent.AggregateFuture.releaseResources.

Clears fields that are no longer needed after this future has completed -- or at least all its inputs have completed (more precisely, after handleAllCompleted() has been called). Often called multiple times (that is, both when the inputs complete and when the output completes).

This is similar to our proposed afterCommit method but not quite the same. See the description of CL 265462958.

Annotations
@Override
com.google.common.util.concurrent back to summary

private final Class CombinedFuture.AsyncCallableInterruptibleTask

extends CombinedFuture<V extends @Nullable Object>.CombinedFutureInterruptibleTask<ListenableFuture<V extends @Nullable Object>>
Class Inheritance
Annotations
@WeakOuter

Field Summary

Modifier and TypeField and Description
private final AsyncCallable<V>

Constructor Summary

AccessConstructor and Description
pack-priv
AsyncCallableInterruptibleTask(AsyncCallable<V> callable, Executor listenerExecutor)

Method Summary

Modifier and TypeMethod and Description
pack-priv ListenableFuture<V>
runInterruptibly()

Implements abstract com.google.common.util.concurrent.InterruptibleTask.runInterruptibly.

Do interruptible work here - do not complete Futures here, as their listeners could be interrupted.
pack-priv void
pack-priv String
Inherited from com.google.common.util.concurrent.CombinedFuture.CombinedFutureInterruptibleTask:
afterRanInterruptiblyFailureafterRanInterruptiblySuccessexecuteisDone

Field Detail

callableback to summary
private final AsyncCallable<V> callable

Constructor Detail

AsyncCallableInterruptibleTaskback to summary
pack-priv AsyncCallableInterruptibleTask(AsyncCallable<V> callable, Executor listenerExecutor)

Method Detail

runInterruptiblyback to summary
pack-priv ListenableFuture<V> runInterruptibly() throws Exception

Implements abstract com.google.common.util.concurrent.InterruptibleTask.runInterruptibly.

Doc from com.google.common.util.concurrent.InterruptibleTask.runInterruptibly.

Do interruptible work here - do not complete Futures here, as their listeners could be interrupted.

Annotations
@Override
setValueback to summary
pack-priv void setValue(ListenableFuture<V> value)

Implements abstract com.google.common.util.concurrent.CombinedFuture.CombinedFutureInterruptibleTask.setValue.

Annotations
@Override
toPendingStringback to summary
pack-priv String toPendingString()

Implements abstract com.google.common.util.concurrent.InterruptibleTask.toPendingString.

Annotations
@Override
com.google.common.util.concurrent back to summary

private final Class CombinedFuture.CallableInterruptibleTask

extends CombinedFuture<V extends @Nullable Object>.CombinedFutureInterruptibleTask<V extends @Nullable Object>
Class Inheritance
Annotations
@WeakOuter

Field Summary

Modifier and TypeField and Description
private final Callable<V>

Constructor Summary

AccessConstructor and Description
pack-priv
CallableInterruptibleTask(Callable<V> callable, Executor listenerExecutor)

Method Summary

Modifier and TypeMethod and Description
pack-priv V
runInterruptibly()

Implements abstract com.google.common.util.concurrent.InterruptibleTask.runInterruptibly.

Do interruptible work here - do not complete Futures here, as their listeners could be interrupted.
pack-priv void
pack-priv String
Inherited from com.google.common.util.concurrent.CombinedFuture.CombinedFutureInterruptibleTask:
afterRanInterruptiblyFailureafterRanInterruptiblySuccessexecuteisDone

Field Detail

callableback to summary
private final Callable<V> callable

Constructor Detail

CallableInterruptibleTaskback to summary
pack-priv CallableInterruptibleTask(Callable<V> callable, Executor listenerExecutor)

Method Detail

runInterruptiblyback to summary
pack-priv V runInterruptibly() throws Exception

Implements abstract com.google.common.util.concurrent.InterruptibleTask.runInterruptibly.

Doc from com.google.common.util.concurrent.InterruptibleTask.runInterruptibly.

Do interruptible work here - do not complete Futures here, as their listeners could be interrupted.

Annotations
@Override
@ParametricNullness
setValueback to summary
pack-priv void setValue(V value)

Implements abstract com.google.common.util.concurrent.CombinedFuture.CombinedFutureInterruptibleTask.setValue.

Annotations
@Override
toPendingStringback to summary
pack-priv String toPendingString()

Implements abstract com.google.common.util.concurrent.InterruptibleTask.toPendingString.

Annotations
@Override
com.google.common.util.concurrent back to summary

private abstract Class CombinedFuture.CombinedFutureInterruptibleTask<T extends @Nullable Object>

extends InterruptibleTask<T extends @Nullable Object>
Class Inheritance
Known Direct Subclasses
com.google.common.util.concurrent.CombinedFuture.AsyncCallableInterruptibleTask, com.google.common.util.concurrent.CombinedFuture.CallableInterruptibleTask
Annotations
@WeakOuter

Field Summary

Modifier and TypeField and Description
private final Executor

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv final void
afterRanInterruptiblyFailure(Throwable error)

Implements abstract com.google.common.util.concurrent.InterruptibleTask.afterRanInterruptiblyFailure.

Any interruption that happens as a result of calling interruptTask will arrive before this method is called.
pack-priv final void
afterRanInterruptiblySuccess(T result)

Implements abstract com.google.common.util.concurrent.InterruptibleTask.afterRanInterruptiblySuccess.

Any interruption that happens as a result of calling interruptTask will arrive before this method is called.
pack-priv final void
pack-priv final boolean
isDone()

Implements abstract com.google.common.util.concurrent.InterruptibleTask.isDone.

Called before runInterruptibly - if true, runInterruptibly and afterRanInterruptibly will not be called.
pack-priv abstract void
setValue(T value)

Inherited from com.google.common.util.concurrent.InterruptibleTask:
interruptTaskrunrunInterruptiblytoPendingStringtoString

Field Detail

listenerExecutorback to summary
private final Executor listenerExecutor

Constructor Detail

CombinedFutureInterruptibleTaskback to summary
pack-priv CombinedFutureInterruptibleTask(Executor listenerExecutor)

Method Detail

afterRanInterruptiblyFailureback to summary
pack-priv final void afterRanInterruptiblyFailure(Throwable error)

Implements abstract com.google.common.util.concurrent.InterruptibleTask.afterRanInterruptiblyFailure.

Doc from com.google.common.util.concurrent.InterruptibleTask.afterRanInterruptiblyFailure.

Any interruption that happens as a result of calling interruptTask will arrive before this method is called. Complete Futures here.

Annotations
@Override
afterRanInterruptiblySuccessback to summary
pack-priv final void afterRanInterruptiblySuccess(T result)

Implements abstract com.google.common.util.concurrent.InterruptibleTask.afterRanInterruptiblySuccess.

Doc from com.google.common.util.concurrent.InterruptibleTask.afterRanInterruptiblySuccess.

Any interruption that happens as a result of calling interruptTask will arrive before this method is called. Complete Futures here.

Annotations
@Override
executeback to summary
pack-priv final void execute()
isDoneback to summary
pack-priv final boolean isDone()

Implements abstract com.google.common.util.concurrent.InterruptibleTask.isDone.

Doc from com.google.common.util.concurrent.InterruptibleTask.isDone.

Called before runInterruptibly - if true, runInterruptibly and afterRanInterruptibly will not be called.

Annotations
@Override
setValueback to summary
pack-priv abstract void setValue(T value)