public class ActionRetrier extends Object implements IActionRetrier
| Constructor and Description |
|---|
ActionRetrier(IRetryConfiguration retryConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
void |
doWithRetry(Runnable runnable,
Collection<Class<? extends Throwable>> handledExceptions)
Retries the action when the handled exception occurs.
|
<T> T |
doWithRetry(Supplier<T> function,
Collection<Class<? extends Throwable>> handledExceptions)
Retries the function when the handled exception occurs.
|
protected boolean |
isExceptionHandled(Collection<Class<? extends Throwable>> handledExceptions,
Exception exception) |
@Inject public ActionRetrier(IRetryConfiguration retryConfiguration)
public void doWithRetry(Runnable runnable, Collection<Class<? extends Throwable>> handledExceptions)
IActionRetrierdoWithRetry in interface IActionRetrierrunnable - Action to be applied.handledExceptions - Exceptions to be handled.public <T> T doWithRetry(Supplier<T> function, Collection<Class<? extends Throwable>> handledExceptions)
IActionRetrierdoWithRetry in interface IActionRetrierT - Return type of function.function - Function to be applied.handledExceptions - Exceptions to be handled.protected boolean isExceptionHandled(Collection<Class<? extends Throwable>> handledExceptions, Exception exception)
Copyright © 2020. All rights reserved.