Class AbstractHealthIndicator<T>
java.lang.Object
io.micronaut.management.health.indicator.AbstractHealthIndicator<T>
- Type Parameters:
T
- The health indication type
- All Implemented Interfaces:
Ordered
,HealthIndicator
- Direct Known Subclasses:
DiskSpaceIndicator
A base health indicator class to extend from that catches exceptions thrown from the
getHealthInformation()
method and updates the HealthResult
with the exception information.
- Since:
- 1.0
- Author:
- James Kleeh
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T
Provides information (typically a Map) to be returned.protected HealthResult
Builds the whole health result.protected abstract String
getName()
Used to populate theHealthResult
.void
setExecutorService
(ExecutorService executorService)
-
Field Details
-
executorService
-
healthStatus
-
-
Constructor Details
-
AbstractHealthIndicator
public AbstractHealthIndicator()
-
-
Method Details
-
setExecutorService
- Parameters:
executorService
- The executor service
-
getResult
- Specified by:
getResult
in interfaceHealthIndicator
- Returns:
- A publisher that returns a
HealthResult
that provides the information necessary to build a response.
-
getHealthInformation
Provides information (typically a Map) to be returned. Set thehealthStatus
field during execution, otherwiseHealthStatus.UNKNOWN
will be used.- Returns:
- Any details to be included in the response.
-
getHealthResult
Builds the whole health result.- Returns:
- The health result to provide to the indicator.
-
getName
Used to populate theHealthResult
. Provides a key to go along with the health information.- Returns:
- The name of the indicator
-