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

pack-priv abstract Class AbstractCatchingFuture<V extends @Nullable Object, X extends java.lang.Throwable, F, T extends @Nullable Object>

extends FluentFuture.TrustedFuture<V extends @Nullable Object>
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Known Direct Subclasses
com.google.common.util.concurrent.AbstractCatchingFuture.AsyncCatchingFuture, com.google.common.util.concurrent.AbstractCatchingFuture.CatchingFuture
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
@SuppressWarnings:nullness
Static Imports
com.google.common.base.Preconditions.checkNotNull, com.google.common.util.concurrent.Futures.getDone, .MoreExecutors.rejectionPropagatingExecutor, .NullnessCasts.uncheckedCastNullableTToT, .Platform.isInstanceOfThrowableClass, .Platform.restoreInterruptIfIsInterruptedException

Implementations of Futures.catching*.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
pack-priv Class<X>
pack-priv F
pack-priv ListenableFuture<? extends V>

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractCatchingFuture(ListenableFuture<? extends V> inputFuture, Class<X> exceptionType, F fallback)

Method Summary

Modifier and TypeMethod and Description
protected final void
afterDone()

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

Callback method that is called exactly once after the future is completed.
pack-priv static <V extends @Nullable Object, X extends Throwable> ListenableFuture<V>
create(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback, Executor executor)

pack-priv static <X extends Throwable, V extends @Nullable Object> ListenableFuture<V>
create(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback, Executor executor)

pack-priv abstract T
doFallback(F fallback, X throwable)

Template method for subtypes to actually run the fallback.

protected String
pendingToString()

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

Provide a human-readable explanation of why this future has not yet completed.
public final void
run()

Implements java.lang.Runnable.run.

Runs this operation.
pack-priv abstract void
setResult(T result)

Template method for subtypes to actually set the result.

Inherited from com.google.common.util.concurrent.FluentFuture.TrustedFuture:
addListenercancelgetgetisCancelledisDone

Field Detail

exceptionTypeback to summary
pack-priv Class<X> exceptionType
Annotations
@CheckForNull
fallbackback to summary
pack-priv F fallback
Annotations
@CheckForNull
inputFutureback to summary
pack-priv ListenableFuture<? extends V> inputFuture
Annotations
@CheckForNull

Constructor Detail

AbstractCatchingFutureback to summary
pack-priv AbstractCatchingFuture(ListenableFuture<? extends V> inputFuture, Class<X> exceptionType, F fallback)

Method Detail

afterDoneback to summary
protected final void afterDone()

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

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

Callback method that is called exactly once after the future is completed.

If interruptTask is also run during completion, afterDone runs after it.

The default implementation of this method in AbstractFuture does nothing. This is intended for very lightweight cleanup work, for example, timing statistics or clearing fields. If your task does anything heavier consider, just using a listener with an executor.

Annotations
@Override
createback to summary
pack-priv static <V extends @Nullable Object, X extends Throwable> ListenableFuture<V> create(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback, Executor executor)
createback to summary
pack-priv static <X extends Throwable, V extends @Nullable Object> ListenableFuture<V> create(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback, Executor executor)
doFallbackback to summary
pack-priv abstract T doFallback(F fallback, X throwable) throws Exception

Template method for subtypes to actually run the fallback.

Annotations
@ForOverride
@ParametricNullness
pendingToStringback to summary
protected String pendingToString()

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

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

Provide a human-readable explanation of why this future has not yet completed.

Returns:String

null if an explanation cannot be provided (e.g. because the future is done).

Annotations
@Override
@CheckForNull
runback to summary
public final void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
setResultback to summary
pack-priv abstract void setResult(T result)

Template method for subtypes to actually set the result.

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

private final Class AbstractCatchingFuture.AsyncCatchingFuture<V extends @Nullable Object, X extends java.lang.Throwable>

extends AbstractCatchingFuture<V extends @Nullable Object, X extends Throwable, AsyncFunction<? super X extends Throwable, ? extends V extends @Nullable Object>, ListenableFuture<? extends V extends @Nullable Object>>
Class Inheritance

An AbstractCatchingFuture that delegates to an AsyncFunction and setFuture(ListenableFuture).

Field Summary

Inherited from com.google.common.util.concurrent.AbstractCatchingFuture:
exceptionTypefallbackinputFuture

Constructor Summary

AccessConstructor and Description
pack-priv
AsyncCatchingFuture(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback)

Method Summary

Modifier and TypeMethod and Description
pack-priv ListenableFuture<? extends V>
doFallback(AsyncFunction<? super X, ? extends V> fallback, X cause)

Implements abstract com.google.common.util.concurrent.AbstractCatchingFuture.doFallback.

Template method for subtypes to actually run the fallback.
pack-priv void
setResult(ListenableFuture<? extends V> result)

Implements abstract com.google.common.util.concurrent.AbstractCatchingFuture.setResult.

Template method for subtypes to actually set the result.
Inherited from com.google.common.util.concurrent.AbstractCatchingFuture:
afterDonecreatecreatependingToStringrun

Constructor Detail

AsyncCatchingFutureback to summary
pack-priv AsyncCatchingFuture(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback)

Method Detail

doFallbackback to summary
pack-priv ListenableFuture<? extends V> doFallback(AsyncFunction<? super X, ? extends V> fallback, X cause) throws Exception

Implements abstract com.google.common.util.concurrent.AbstractCatchingFuture.doFallback.

Doc from com.google.common.util.concurrent.AbstractCatchingFuture.doFallback.

Template method for subtypes to actually run the fallback.

Annotations
@Override
setResultback to summary
pack-priv void setResult(ListenableFuture<? extends V> result)

Implements abstract com.google.common.util.concurrent.AbstractCatchingFuture.setResult.

Doc from com.google.common.util.concurrent.AbstractCatchingFuture.setResult.

Template method for subtypes to actually set the result.

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

private final Class AbstractCatchingFuture.CatchingFuture<V extends @Nullable Object, X extends java.lang.Throwable>

extends AbstractCatchingFuture<V extends @Nullable Object, X extends Throwable, Function<? super X extends Throwable, ? extends V extends @Nullable Object>, V extends @Nullable Object>
Class Inheritance

An AbstractCatchingFuture that delegates to a Function and set(Object).

Field Summary

Inherited from com.google.common.util.concurrent.AbstractCatchingFuture:
exceptionTypefallbackinputFuture

Constructor Summary

AccessConstructor and Description
pack-priv
CatchingFuture(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback)

Method Summary

Modifier and TypeMethod and Description
pack-priv V
doFallback(Function<? super X, ? extends V> fallback, X cause)

Implements abstract com.google.common.util.concurrent.AbstractCatchingFuture.doFallback.

Template method for subtypes to actually run the fallback.
pack-priv void
setResult(V result)

Implements abstract com.google.common.util.concurrent.AbstractCatchingFuture.setResult.

Template method for subtypes to actually set the result.
Inherited from com.google.common.util.concurrent.AbstractCatchingFuture:
afterDonecreatecreatependingToStringrun

Constructor Detail

CatchingFutureback to summary
pack-priv CatchingFuture(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback)

Method Detail

doFallbackback to summary
pack-priv V doFallback(Function<? super X, ? extends V> fallback, X cause) throws Exception

Implements abstract com.google.common.util.concurrent.AbstractCatchingFuture.doFallback.

Doc from com.google.common.util.concurrent.AbstractCatchingFuture.doFallback.

Template method for subtypes to actually run the fallback.

Annotations
@Override
@ParametricNullness
setResultback to summary
pack-priv void setResult(V result)

Implements abstract com.google.common.util.concurrent.AbstractCatchingFuture.setResult.

Doc from com.google.common.util.concurrent.AbstractCatchingFuture.setResult.

Template method for subtypes to actually set the result.

Annotations
@Override