Package org.axonframework.common
Class ProcessUtils
java.lang.Object
org.axonframework.common.ProcessUtils
Processing utilities.
- Since:
- 4.2
- Author:
- Marc Gathier
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidexecuteUntilTrue(BooleanSupplier runnable, long retryInterval, long maxTries) Executes an action, with potential retry in case the result is false.static voidexecuteWithRetry(Runnable runnable, Predicate<RuntimeException> retryPredicate, long timeout, TimeUnit timeUnit, long retryInterval) Executes an action, with potential retry in case of an exception.
-
Method Details
-
executeWithRetry
public static void executeWithRetry(Runnable runnable, Predicate<RuntimeException> retryPredicate, long timeout, TimeUnit timeUnit, long retryInterval) Executes an action, with potential retry in case of an exception.- Parameters:
runnable- action to executeretryPredicate- predicate to determine if the action should be retried based on the exceptiontimeout- timeout for the retriestimeUnit- unit for the timeoutretryInterval- time to wait between retries of the action
-
executeUntilTrue
Executes an action, with potential retry in case the result is false. Exception handling should be taken care of within the action if needed.- Parameters:
runnable- action to execute, will be executed till the result is true, or max tries is reachedretryInterval- time to wait between retries of the actionmaxTries- maximum number of times the action is invoked
-