Class RetryInterceptor

java.lang.Object
org.flowable.common.engine.impl.interceptor.AbstractCommandInterceptor
org.flowable.common.engine.impl.interceptor.RetryInterceptor
All Implemented Interfaces:
CommandInterceptor
Direct Known Subclasses:
JtaRetryInterceptor

public class RetryInterceptor extends AbstractCommandInterceptor
Intercepts FlowableOptimisticLockingException and tries to run the same command again. The number of retries and the time waited between retries is configurable.
Author:
Daniel Meyer
  • Field Details

    • numOfRetries

      protected int numOfRetries
    • waitTimeInMs

      protected int waitTimeInMs
    • waitIncreaseFactor

      protected int waitIncreaseFactor
  • Constructor Details

    • RetryInterceptor

      public RetryInterceptor()
  • Method Details

    • execute

      public <T> T execute(CommandConfig config, Command<T> command, CommandExecutor commandExecutor)
    • waitBeforeRetry

      protected void waitBeforeRetry(long waitTime)
    • setNumOfRetries

      public void setNumOfRetries(int numOfRetries)
    • setWaitIncreaseFactor

      public void setWaitIncreaseFactor(int waitIncreaseFactor)
    • setWaitTimeInMs

      public void setWaitTimeInMs(int waitTimeInMs)
    • getNumOfRetries

      public int getNumOfRetries()
    • getWaitIncreaseFactor

      public int getWaitIncreaseFactor()
    • getWaitTimeInMs

      public int getWaitTimeInMs()