类 AbstractHealthIndicator
- java.lang.Object
- org.springframework.boot.actuate.health.AbstractHealthIndicator
- 所有已实现的接口:
HealthIndicator
- 直接已知子类:
ApplicationHealthIndicator
,CassandraHealthIndicator
,CouchbaseHealthIndicator
,DataSourceHealthIndicator
,DiskSpaceHealthIndicator
,ElasticsearchHealthIndicator
,ElasticsearchJestHealthIndicator
,ElasticsearchRestHealthIndicator
,InfluxDbHealthIndicator
,JmsHealthIndicator
,LdapHealthIndicator
,MailHealthIndicator
,MongoHealthIndicator
,Neo4jHealthIndicator
,RabbitHealthIndicator
,RedisHealthIndicator
,SolrHealthIndicator
public abstract class AbstractHealthIndicator extends Object implements HealthIndicator
BaseHealthIndicator
implementations that encapsulates creation ofHealth
instance and error handling.This implementation is only suitable if an
Exception
raised fromdoHealthCheck(org.springframework.boot.actuate.health.Health.Builder)
should create aStatus.DOWN
health status.- 从以下版本开始:
- 1.1.0
构造器概要
构造器 限定符 构造器 说明 protected
AbstractHealthIndicator()
Create a newAbstractHealthIndicator
instance with a defaulthealthCheckFailedMessage
.protected
AbstractHealthIndicator(String healthCheckFailedMessage)
Create a newAbstractHealthIndicator
instance with a specific message to log when the health check fails.protected
AbstractHealthIndicator(Function<Exception,String> healthCheckFailedMessage)
Create a newAbstractHealthIndicator
instance with a specific message to log when the health check fails.
构造器详细资料
AbstractHealthIndicator
protected AbstractHealthIndicator()
Create a newAbstractHealthIndicator
instance with a defaulthealthCheckFailedMessage
.
AbstractHealthIndicator
protected AbstractHealthIndicator(String healthCheckFailedMessage)
Create a newAbstractHealthIndicator
instance with a specific message to log when the health check fails.- 参数:
healthCheckFailedMessage
- the message to log on health check failure- 从以下版本开始:
- 2.0.0
AbstractHealthIndicator
protected AbstractHealthIndicator(Function<Exception,String> healthCheckFailedMessage)
Create a newAbstractHealthIndicator
instance with a specific message to log when the health check fails.- 参数:
healthCheckFailedMessage
- the message to log on health check failure- 从以下版本开始:
- 2.0.0
方法详细资料
health
public final Health health()
从接口复制的说明:HealthIndicator
Return an indication of health.- 指定者:
health
在接口中HealthIndicator
- 返回:
- the health for
doHealthCheck
protected abstract void doHealthCheck(Health.Builder builder) throws Exception
Actual health check logic.- 参数:
builder
- theHealth.Builder
to report health status and details- 抛出:
Exception
- anyException
that should create aStatus.DOWN
system status.