Class RetryingRunnable

java.lang.Object
org.eblocker.server.common.executor.RetryingRunnable
All Implemented Interfaces:
Runnable

public class RetryingRunnable extends Object implements Runnable
A wrapper class for Runnable that catches up to maxRetries exceptions (in a row), before it gives up and re-throws the exception. This is useful only for Runnables that are scheduled at regular time intervals.
  • Constructor Details

    • RetryingRunnable

      public RetryingRunnable(Runnable runnable, long maxRetries)
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable