Interface FutureFallback<V>
-
- Type Parameters:
V- the result type of the provided backupFuture
@Beta @Deprecated @GwtCompatible public interface FutureFallback<V>
Deprecated.This interface's main user,Futures.withFallback, has been updated to useAsyncFunction. We recommend that other APIs be updated in the same way. This interface will be removed in Guava release 20.0.Provides a backupFutureto replace an earlier failedFuture. An implementation of this interface can be applied to an inputFuturewithFutures.withFallback(com.google.common.util.concurrent.ListenableFuture<? extends V>, com.google.common.util.concurrent.FutureFallback<? extends V>).- Since:
- 14.0
- Author:
- Bruno Diniz
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ListenableFuture<V>create(java.lang.Throwable t)Deprecated.Returns aFutureto be used in place of theFuturethat failed with the given exception.
-
-
-
Method Detail
-
create
ListenableFuture<V> create(java.lang.Throwable t) throws java.lang.Exception
Deprecated.Returns aFutureto be used in place of theFuturethat failed with the given exception. The exception is provided so that theFallbackimplementation can conditionally determine whether to propagate the exception or to attempt to recover.- Parameters:
t- the exception that made the future fail. If the future'sgetmethod throws anExecutionException, then the cause is passed to this method. Any other thrown object is passed unaltered.- Throws:
java.lang.Exception
-
-