Class HealthcheckRunner<T>
- java.lang.Object
-
- org.aksw.commons.util.healthcheck.HealthcheckRunner<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHealthcheckRunner.Builder<X>
-
Field Summary
Fields Modifier and Type Field Description protected Callable<? extends T>actionprotected List<java.util.function.Supplier<Boolean>>continuationConditionsprotected List<java.util.function.Predicate<? super Throwable>>fatalConditionsprotected longintervalprotected TimeUnitintervalTimeUnitprotected booleanisAbortedprotected longretryCountprotected ThreadthreadThe thread that calledrun()
-
Constructor Summary
Constructors Constructor Description HealthcheckRunner(long retryCount, long interval, TimeUnit intervalTimeUnit, Callable<? extends T> action, List<java.util.function.Predicate<? super Throwable>> fatalConditions, List<java.util.function.Supplier<Boolean>> continuationConditions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()static HealthcheckRunner.Builder<Void>builder()Tcall()booleanisAborted()booleanisConditionallyAborted()voidrun()Prefer this method if the result should be ignored
-
-
-
Field Detail
-
retryCount
protected long retryCount
-
interval
protected long interval
-
intervalTimeUnit
protected TimeUnit intervalTimeUnit
-
isAborted
protected boolean isAborted
-
-
Method Detail
-
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
-
-