public abstract class ProcessUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
executeUntilTrue(BooleanSupplier runnable,
long retryInterval,
long maxTries)
Executes an action, with potential retry in case the result is false.
|
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.
|
public static void executeWithRetry(Runnable runnable, Predicate<RuntimeException> retryPredicate, long timeout, TimeUnit timeUnit, long retryInterval)
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 actionpublic static void executeUntilTrue(BooleanSupplier runnable, long retryInterval, long maxTries)
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 invokedCopyright © 2010–2023. All rights reserved.