Package com.github.jpmsilva.jsystemd
Class PendingHealthProvider
java.lang.Object
com.github.jpmsilva.jsystemd.PendingHealthProvider
- All Implemented Interfaces:
HealthProvider
public class PendingHealthProvider extends Object implements HealthProvider
Implementation of
HealthProvider
that suppresses/delays the unhealthy state of a delegate for a configurable period.- Author:
- Christian Lorenz
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.jpmsilva.jsystemd.HealthProvider
HealthProvider.Health
-
Constructor Summary
Constructors Constructor Description PendingHealthProvider(@NotNull HealthProvider delegate, long delay, @NotNull TemporalUnit delayUnit)
Creates a new health provider that delegates the actual work to thedelegate
, and delays reporting unhealthy status. -
Method Summary
Modifier and Type Method Description HealthProvider.Health
health()
Determines if an application is healthy.
-
Constructor Details
-
PendingHealthProvider
public PendingHealthProvider(@NotNull @NotNull HealthProvider delegate, long delay, @NotNull @NotNull TemporalUnit delayUnit)Creates a new health provider that delegates the actual work to thedelegate
, and delays reporting unhealthy status.- Parameters:
delegate
- health provider from which to obtain the true health status of the application, nevernull
delay
- time that has to be elapsed before the real unhealthy status is provideddelayUnit
-TemporalUnit
fordelay
, nevernull
-
-
Method Details
-
health
Description copied from interface:HealthProvider
Determines if an application is healthy.- Specified by:
health
in interfaceHealthProvider
- Returns:
- true if application is healthy, otherwise false
-