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

    Constructors
    Modifier
    Constructor
    Description
    protected
    An abstract class that implements the HealthIndicator interface to provide asynchronous health checks.
    protected
    AsyncHealthIndicator(int maxFailures)
    An abstract class that implements the HealthIndicator interface to provide asynchronous health checks.
    protected
    AsyncHealthIndicator(int maxFailures, Duration delay, Duration period)
    An abstract class that implements the HealthIndicator interface to provide asynchronous health checks.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.boot.actuate.health.Health
    getHealth(boolean includeDetails)
     
    org.springframework.boot.actuate.health.Health
     
    protected abstract org.springframework.boot.actuate.health.Health
    Retrieves the current health status.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      protected AsyncHealthIndicator(int maxFailures, Duration delay, Duration period)
      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:
      health in interface org.springframework.boot.actuate.health.HealthIndicator
    • getHealth

      public org.springframework.boot.actuate.health.Health getHealth(boolean includeDetails)
      Specified by:
      getHealth in interface org.springframework.boot.actuate.health.HealthIndicator