V - the type of the call return valuepublic final class Retryer<V> extends Object
RetryerBuilder. A retryer
is thread-safe, provided the arguments passed to its constructor are thread-safe.| 限定符和类型 | 类和说明 |
|---|---|
static class |
Retryer.RetryerCallable<X>
|
public V call(Callable<V> callable) throws ExecutionException, RetryException
callable - the callable task to be executedExecutionException - if the given callable throws an exception, and the
rejection predicate considers the attempt as successful. The original exception
is wrapped into an ExecutionException.RetryException - if all the attempts failed before the stop strategy decided
to abort, or the thread was interrupted. Note that if the thread is interrupted,
this exception is thrown and the thread's interrupt status is set.public Retryer.RetryerCallable<V> wrap(Callable<V> callable)
Callable in a Retryer.RetryerCallable, which can
be submitted to an executor. The returned Retryer.RetryerCallable uses
this Retryer instance to call the given Callable.callable - the callable to wrapRetryer.RetryerCallable that behaves like the given Callable with retry behavior defined by this RetryerCopyright © 2018. All rights reserved.