public interface RetryDecision<T,C extends Callable<? extends T>>
Modifier and Type | Interface and Description |
---|---|
static class |
RetryDecision.Type |
Modifier and Type | Field and Description |
---|---|
static RetryDecision<?,?> |
ABORT |
Modifier and Type | Method and Description |
---|---|
static RetryDecision |
abort() |
static <T> RetryDecision<T,? extends Callable<? extends T>> |
abortReturn(T result)
Abort operation and return the provided Object.
|
static RetryDecision |
abortThrow(Exception exception)
Abort operation with a custom Exception.
|
RetryDecision.Type |
getDecisionType() |
long |
getDelayNanos() |
C |
getNewCallable() |
Either<Exception,T> |
getResult() |
static <T,C extends Callable<? extends T>> |
retry(long retryNanos,
C callable) |
static <T,C extends Callable<? extends T>> |
retry(long time,
TimeUnit unit,
C callable) |
static <T,C extends Callable<? extends T>> |
retryDefault(C callable) |
static final RetryDecision<?,?> ABORT
@CheckReturnValue static RetryDecision abort()
@CheckReturnValue static RetryDecision abortThrow(@Nonnull Exception exception)
exception
- the custom exception.@CheckReturnValue static <T> RetryDecision<T,? extends Callable<? extends T>> abortReturn(T result)
result
- @CheckReturnValue static <T,C extends Callable<? extends T>> RetryDecision<T,C> retry(@Nonnegative long time, TimeUnit unit, @Nonnull C callable)
@CheckReturnValue static <T,C extends Callable<? extends T>> RetryDecision<T,C> retry(@Nonnegative long retryNanos, @Nonnull C callable)
@CheckReturnValue static <T,C extends Callable<? extends T>> RetryDecision<T,C> retryDefault(@Nonnull C callable)
@CheckReturnValue @Nonnull RetryDecision.Type getDecisionType()
@CheckReturnValue long getDelayNanos()
@CheckReturnValue @Nullable Either<Exception,T> getResult()
@CheckReturnValue @Nonnull C getNewCallable()
Copyright © 2018 SPF4J. All rights reserved.