Class ProcessUtils

java.lang.Object
org.axonframework.common.ProcessUtils

public final class ProcessUtils extends Object
Processing utilities.
Since:
4.2
Author:
Marc Gathier
  • 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 execute
      retryPredicate - predicate to determine if the action should be retried based on the exception
      timeout - timeout for the retries
      timeUnit - unit for the timeout
      retryInterval - time to wait between retries of the action
    • executeUntilTrue

      public static void executeUntilTrue(BooleanSupplier runnable, long retryInterval, long maxTries)
      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 reached
      retryInterval - time to wait between retries of the action
      maxTries - maximum number of times the action is invoked