Interface HealthCheck

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface HealthCheck
Functional interface for performing a health check. 执行健康检查的函数式接口。

Implementations should return a HealthResult describing the current health of the component being checked. If the check throws an exception, the HealthRegistry will catch it and produce a HealthStatus.DOWN result.

实现应返回描述被检查组件当前健康状况的 HealthResult。 如果检查抛出异常,HealthRegistry 将捕获并生成 HealthStatus.DOWN 结果。

Since:
JDK 25, opencode-base-observability V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Executes the health check and returns the result.
  • Method Details

    • check

      HealthResult check()
      Executes the health check and returns the result. 执行健康检查并返回结果。
      Returns:
      the health check result | 健康检查结果