V
- the result type of the provided backup Future
Futures.withFallback
, has been updated to use AsyncFunction
. We
recommend that other APIs be updated in the same way. This interface will be removed in Guava
release 20.0.@Beta @Deprecated @GwtCompatible public interface FutureFallback<V>
Future
to replace an earlier failed Future
. An implementation
of this interface can be applied to an input Future
with Futures.withFallback(com.google.common.util.concurrent.ListenableFuture<? extends V>, com.google.common.util.concurrent.FutureFallback<? extends V>)
.Modifier and Type | Method and Description |
---|---|
ListenableFuture<V> |
create(Throwable t)
Deprecated.
Returns a
Future to be used in place of the Future that failed with the given
exception. |
ListenableFuture<V> create(Throwable t) throws Exception
Future
to be used in place of the Future
that failed with the given
exception. The exception is provided so that the Fallback
implementation can
conditionally determine whether to propagate the exception or to attempt to recover.t
- the exception that made the future fail. If the future's get
method throws an ExecutionException
, then the cause is passed to this method. Any
other thrown object is passed unaltered.Exception
Copyright © 2010-2015. All Rights Reserved.