Class AbstractHealthIndicator
java.lang.Object
org.springframework.boot.actuate.health.AbstractHealthIndicator
- All Implemented Interfaces:
HealthContributor,HealthIndicator
- Direct Known Subclasses:
AvailabilityStateHealthIndicator,CassandraDriverHealthIndicator,CouchbaseHealthIndicator,DataSourceHealthIndicator,DiskSpaceHealthIndicator,ElasticsearchRestClientHealthIndicator,HazelcastHealthIndicator,InfluxDbHealthIndicator,JmsHealthIndicator,LdapHealthIndicator,MailHealthIndicator,MongoHealthIndicator,Neo4jHealthIndicator,PingHealthIndicator,RabbitHealthIndicator,RedisHealthIndicator
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
ConstructorsModifierConstructorDescriptionprotectedCreate a newAbstractHealthIndicatorinstance with a defaulthealthCheckFailedMessage.protectedAbstractHealthIndicator(String healthCheckFailedMessage) Create a newAbstractHealthIndicatorinstance with a specific message to log when the health check fails.protectedAbstractHealthIndicator(Function<Exception, String> healthCheckFailedMessage) Create a newAbstractHealthIndicatorinstance with a specific message to log when the health check fails. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoHealthCheck(Health.Builder builder) Actual health check logic.final Healthhealth()Return an indication of health.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.actuate.health.HealthIndicator
getHealth
-
Constructor Details
-
AbstractHealthIndicator
protected AbstractHealthIndicator()Create a newAbstractHealthIndicatorinstance with a defaulthealthCheckFailedMessage. -
AbstractHealthIndicator
Create a newAbstractHealthIndicatorinstance 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 newAbstractHealthIndicatorinstance 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:HealthIndicatorReturn an indication of health.- Specified by:
healthin interfaceHealthIndicator- Returns:
- the health
-
doHealthCheck
Actual health check logic.- Parameters:
builder- theHealth.Builderto report health status and details- Throws:
Exception- anyExceptionthat should create aStatus.DOWNsystem status.
-