Class EurekaHealthCheckHandler
- java.lang.Object
-
- org.springframework.cloud.netflix.eureka.EurekaHealthCheckHandler
-
- All Implemented Interfaces:
com.netflix.appinfo.HealthCheckHandler,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.core.Ordered
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
A Eureka health checker, maps the application status intoInstanceInfo.InstanceStatusthat will be propagated to Eureka registry. On each heartbeat Eureka performs the health check invoking registeredHealthCheckHandler. By default this implementation will perform aggregation of all registeredHealthIndicatorthrough registeredStatusAggregator. Anullstatus 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.- Author:
- Jakub Narloch, Spencer Gibb, Nowrin Anwar Joyita, Bertrand Renuart, Olga Maciaszek-Sharma
- See Also:
HealthCheckHandler,StatusAggregator
-
-
Constructor Summary
Constructors Constructor Description EurekaHealthCheckHandler(org.springframework.boot.actuate.health.StatusAggregator statusAggregator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected com.netflix.appinfo.InstanceInfo.InstanceStatusgetHealthStatus()intgetOrder()com.netflix.appinfo.InstanceInfo.InstanceStatusgetStatus(com.netflix.appinfo.InstanceInfo.InstanceStatus instanceStatus)protected org.springframework.boot.actuate.health.StatusgetStatus(org.springframework.boot.actuate.health.StatusAggregator statusAggregator)booleanisRunning()protected com.netflix.appinfo.InstanceInfo.InstanceStatusmapToInstanceStatus(org.springframework.boot.actuate.health.Status status)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidstart()voidstop()
-
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getStatus
public com.netflix.appinfo.InstanceInfo.InstanceStatus getStatus(com.netflix.appinfo.InstanceInfo.InstanceStatus instanceStatus)
- Specified by:
getStatusin interfacecom.netflix.appinfo.HealthCheckHandler
-
getHealthStatus
protected com.netflix.appinfo.InstanceInfo.InstanceStatus getHealthStatus()
-
getStatus
protected org.springframework.boot.actuate.health.Status getStatus(org.springframework.boot.actuate.health.StatusAggregator statusAggregator)
-
mapToInstanceStatus
protected com.netflix.appinfo.InstanceInfo.InstanceStatus mapToInstanceStatus(org.springframework.boot.actuate.health.Status status)
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
start
public void start()
- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()
- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()
- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
-