Class HealthcheckRunner<T>

java.lang.Object
org.aksw.commons.util.healthcheck.HealthcheckRunner<T>
All Implemented Interfaces:
Runnable, Callable<T>

public class HealthcheckRunner<T> extends Object implements Callable<T>, Runnable
Run a configurable (health check) action at fixed intervals until this action longer raises an exception. Fatal conditions can be configured to abort the health check early.
Author:
raven
  • Field Details

    • retryCount

      protected long retryCount
    • interval

      protected long interval
    • intervalTimeUnit

      protected TimeUnit intervalTimeUnit
    • action

      protected Callable<? extends T> action
    • fatalConditions

      protected List<Predicate<? super Throwable>> fatalConditions
    • continuationConditions

      protected List<Supplier<Boolean>> continuationConditions
    • isAborted

      protected boolean isAborted
    • thread

      protected volatile Thread thread
      The thread that called run()
  • Constructor Details

  • Method Details

    • builder

      public static HealthcheckRunner.Builder<Void> builder()
    • abort

      public void abort()
    • isAborted

      public boolean isAborted()
    • isConditionallyAborted

      public boolean isConditionallyAborted()
    • run

      public void run()
      Prefer this method if the result should be ignored
      Specified by:
      run in interface Runnable
    • call

      public T call()
      Specified by:
      call in interface Callable<T>