Class AbstractCatchingFuture.AsyncCatchingFuture<V,X extends java.lang.Throwable>
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractFuture<V>
-
- com.google.common.util.concurrent.AbstractFuture.TrustedFuture<V>
-
- com.google.common.util.concurrent.AbstractCatchingFuture<V,X,AsyncFunction<? super X,? extends V>,ListenableFuture<? extends V>>
-
- com.google.common.util.concurrent.AbstractCatchingFuture.AsyncCatchingFuture<V,X>
-
- All Implemented Interfaces:
ListenableFuture<V>
,java.lang.Runnable
,java.util.concurrent.Future<V>
- Enclosing class:
- AbstractCatchingFuture<V,X extends java.lang.Throwable,F,T>
private static final class AbstractCatchingFuture.AsyncCatchingFuture<V,X extends java.lang.Throwable> extends AbstractCatchingFuture<V,X,AsyncFunction<? super X,? extends V>,ListenableFuture<? extends V>>
AnAbstractCatchingFuture
that delegates to anAsyncFunction
andAbstractFuture.setFuture(ListenableFuture)
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.AbstractFuture
AbstractFuture.TrustedFuture<V>
-
-
Field Summary
-
Fields inherited from class com.google.common.util.concurrent.AbstractCatchingFuture
exceptionType, fallback, inputFuture
-
-
Constructor Summary
Constructors Constructor Description AsyncCatchingFuture(ListenableFuture<? extends V> input, java.lang.Class<X> exceptionType, AsyncFunction<? super X,? extends V> fallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) ListenableFuture<? extends V>
doFallback(AsyncFunction<? super X,? extends V> fallback, X cause)
Template method for subtypes to actually run the fallback.(package private) void
setResult(ListenableFuture<? extends V> result)
Template method for subtypes to actually set the result.-
Methods inherited from class com.google.common.util.concurrent.AbstractCatchingFuture
afterDone, create, create, create, create, run
-
Methods inherited from class com.google.common.util.concurrent.AbstractFuture.TrustedFuture
addListener, cancel, get, get, isCancelled, isDone
-
Methods inherited from class com.google.common.util.concurrent.AbstractFuture
interruptTask, maybePropagateCancellation, set, setException, setFuture, trustedGetException, wasInterrupted
-
-
-
-
Constructor Detail
-
AsyncCatchingFuture
AsyncCatchingFuture(ListenableFuture<? extends V> input, java.lang.Class<X> exceptionType, AsyncFunction<? super X,? extends V> fallback)
-
-
Method Detail
-
doFallback
ListenableFuture<? extends V> doFallback(AsyncFunction<? super X,? extends V> fallback, X cause) throws java.lang.Exception
Description copied from class:AbstractCatchingFuture
Template method for subtypes to actually run the fallback.- Specified by:
doFallback
in classAbstractCatchingFuture<V,X extends java.lang.Throwable,AsyncFunction<? super X extends java.lang.Throwable,? extends V>,ListenableFuture<? extends V>>
- Throws:
java.lang.Exception
-
setResult
void setResult(ListenableFuture<? extends V> result)
Description copied from class:AbstractCatchingFuture
Template method for subtypes to actually set the result.- Specified by:
setResult
in classAbstractCatchingFuture<V,X extends java.lang.Throwable,AsyncFunction<? super X extends java.lang.Throwable,? extends V>,ListenableFuture<? extends V>>
-
-