Class AbstractHealthIndicator
java.lang.Object
org.springframework.boot.actuate.health.AbstractHealthIndicator
- All Implemented Interfaces:
HealthContributor
,HealthIndicator
- Direct Known Subclasses:
AvailabilityStateHealthIndicator
,CassandraDriverHealthIndicator
,CouchbaseHealthIndicator
,DataSourceHealthIndicator
,DiskSpaceHealthIndicator
,ElasticsearchRestHealthIndicator
,HazelcastHealthIndicator
,InfluxDbHealthIndicator
,JmsHealthIndicator
,LdapHealthIndicator
,MailHealthIndicator
,MongoHealthIndicator
,Neo4jHealthIndicator
,PingHealthIndicator
,RabbitHealthIndicator
,RedisHealthIndicator
,SolrHealthIndicator
Base
HealthIndicator
implementations that encapsulates creation of
Health
instance and error handling.
This implementation is only suitable if an Exception
raised from
doHealthCheck(org.springframework.boot.actuate.health.Health.Builder)
should
create a Status.DOWN
health status.
- Since:
- 1.1.0
- Author:
- Christian Dupuis
-
Constructor Summary
ModifierConstructorDescriptionprotected
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. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
doHealthCheck
(Health.Builder builder) Actual health check logic.final Health
health()
Return an indication of health.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.boot.actuate.health.HealthIndicator
getHealth
-
Constructor Details
-
AbstractHealthIndicator
protected AbstractHealthIndicator()Create a newAbstractHealthIndicator
instance with a defaulthealthCheckFailedMessage
. -
AbstractHealthIndicator
Create a newAbstractHealthIndicator
instance with a specific message to log when the health check fails.- Parameters:
healthCheckFailedMessage
- the message to log on health check failure- Since:
- 2.0.0
-
AbstractHealthIndicator
Create a newAbstractHealthIndicator
instance with a specific message to log when the health check fails.- Parameters:
healthCheckFailedMessage
- the message to log on health check failure- Since:
- 2.0.0
-
-
Method Details
-
health
Description copied from interface:HealthIndicator
Return an indication of health.- Specified by:
health
in interfaceHealthIndicator
- Returns:
- the health
-
doHealthCheck
Actual health check logic.- Parameters:
builder
- theHealth.Builder
to report health status and details- Throws:
Exception
- anyException
that should create aStatus.DOWN
system status.
-