Package com.helixframework.api.health
Class AsyncHealthIndicator
java.lang.Object
com.helixframework.api.health.AsyncHealthIndicator
- All Implemented Interfaces:
org.springframework.boot.actuate.health.HealthContributor,org.springframework.boot.actuate.health.HealthIndicator
- Direct Known Subclasses:
HttpHealthIndicator,JdbcHealthIndicator
public abstract class AsyncHealthIndicator
extends Object
implements org.springframework.boot.actuate.health.HealthIndicator
An abstract class that implements the HealthIndicator interface to provide asynchronous health checks.
This class manages a periodic update task that invokes the healthInternal() method to retrieve the current health status.
It keeps track of the failure count and updates the health status accordingly.
If the failure count exceeds the maximum allowed failures, the health status is set to DOWN.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAn abstract class that implements the HealthIndicator interface to provide asynchronous health checks.protectedAsyncHealthIndicator(int maxFailures) An abstract class that implements the HealthIndicator interface to provide asynchronous health checks.protectedAsyncHealthIndicator(int maxFailures, Duration delay, Duration period) An abstract class that implements the HealthIndicator interface to provide asynchronous health checks. -
Method Summary
-
Constructor Details
-
AsyncHealthIndicator
protected AsyncHealthIndicator()An abstract class that implements the HealthIndicator interface to provide asynchronous health checks. This class manages a periodic update task that invokes the healthInternal() method to retrieve the current health status. It keeps track of the failure count and updates the health status accordingly. If the failure count exceeds the maximum allowed failures, the health status is set to DOWN. -
AsyncHealthIndicator
protected AsyncHealthIndicator(int maxFailures) An abstract class that implements the HealthIndicator interface to provide asynchronous health checks. This class manages a periodic update task that invokes the healthInternal() method to retrieve the current health status. It keeps track of the failure count and updates the health status accordingly. If the failure count exceeds the maximum allowed failures, the health status is set to DOWN.- Parameters:
maxFailures- the maximum number of allowed failures before setting the health status to DOWN
-
AsyncHealthIndicator
An abstract class that implements the HealthIndicator interface to provide asynchronous health checks. This class manages a periodic update task that invokes the healthInternal() method to retrieve the current health status. It keeps track of the failure count and updates the health status accordingly. If the failure count exceeds the maximum allowed failures, the health status is set to DOWN.
-
-
Method Details
-
healthInternal
protected abstract org.springframework.boot.actuate.health.Health healthInternal()Retrieves the current health status. This method is called periodically by the AsyncHealthIndicator class to update the health status. It should be implemented by subclasses to provide the actual health check logic.- Returns:
- the current Health status
-
health
public org.springframework.boot.actuate.health.Health health()- Specified by:
healthin interfaceorg.springframework.boot.actuate.health.HealthIndicator
-
getHealth
public org.springframework.boot.actuate.health.Health getHealth(boolean includeDetails) - Specified by:
getHealthin interfaceorg.springframework.boot.actuate.health.HealthIndicator
-