public class EurekaHealthCheckHandler extends Object implements com.netflix.appinfo.HealthCheckHandler, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, org.springframework.context.Lifecycle
InstanceInfo.InstanceStatus
that
will be propagated to Eureka registry.
On each heartbeat Eureka performs the health check invoking registered
HealthCheckHandler
. By default this implementation will perform aggregation of
all registered HealthIndicator
through registered StatusAggregator
.
A null
status is returned when the application context is closed (or in the
process of being closed). This prevents Eureka from updating the health status and only
consider the status present in the current InstanceInfo.HealthCheckHandler
,
StatusAggregator
Constructor and Description |
---|
EurekaHealthCheckHandler(org.springframework.boot.actuate.health.StatusAggregator statusAggregator) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected com.netflix.appinfo.InstanceInfo.InstanceStatus |
getHealthStatus() |
int |
getOrder() |
com.netflix.appinfo.InstanceInfo.InstanceStatus |
getStatus(com.netflix.appinfo.InstanceInfo.InstanceStatus instanceStatus) |
protected org.springframework.boot.actuate.health.Status |
getStatus(org.springframework.boot.actuate.health.StatusAggregator statusAggregator) |
boolean |
isRunning() |
protected com.netflix.appinfo.InstanceInfo.InstanceStatus |
mapToInstanceStatus(org.springframework.boot.actuate.health.Status status) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
start() |
void |
stop() |
public EurekaHealthCheckHandler(org.springframework.boot.actuate.health.StatusAggregator statusAggregator)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public com.netflix.appinfo.InstanceInfo.InstanceStatus getStatus(com.netflix.appinfo.InstanceInfo.InstanceStatus instanceStatus)
getStatus
in interface com.netflix.appinfo.HealthCheckHandler
protected com.netflix.appinfo.InstanceInfo.InstanceStatus getHealthStatus()
protected org.springframework.boot.actuate.health.Status getStatus(org.springframework.boot.actuate.health.StatusAggregator statusAggregator)
protected com.netflix.appinfo.InstanceInfo.InstanceStatus mapToInstanceStatus(org.springframework.boot.actuate.health.Status status)
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.