Search in sources :

Example 1 with SofaBootComponentHealthCheckInfo

use of com.alipay.sofa.healthcheck.service.SofaBootComponentHealthCheckInfo in project sofa-boot by alipay.

the class HealthCheckManager method getHealthIndicator.

public static List<HealthIndicator> getHealthIndicator() {
    List<HealthIndicator> healthIndicators = new ArrayList<HealthIndicator>();
    Map<String, HealthIndicator> stringToHealthIndicator = applicationContext.getBeansOfType(HealthIndicator.class);
    if (!CollectionUtils.isEmpty(stringToHealthIndicator)) {
        for (HealthIndicator healthIndicator : stringToHealthIndicator.values()) {
            if (!(healthIndicator instanceof SofaBootComponentHealthCheckInfo) && !(healthIndicator instanceof SpringContextHealthCheckInfo)) {
                // 排除掉SofaBootComponentHealthCheckInfo 和 SpringContextHealthCheckInfo
                healthIndicators.add(healthIndicator);
            }
        }
    }
    return healthIndicators;
}
Also used : HealthIndicator(org.springframework.boot.actuate.health.HealthIndicator) SpringContextHealthCheckInfo(com.alipay.sofa.healthcheck.service.SpringContextHealthCheckInfo) ArrayList(java.util.ArrayList) SofaBootComponentHealthCheckInfo(com.alipay.sofa.healthcheck.service.SofaBootComponentHealthCheckInfo)

Aggregations

SofaBootComponentHealthCheckInfo (com.alipay.sofa.healthcheck.service.SofaBootComponentHealthCheckInfo)1 SpringContextHealthCheckInfo (com.alipay.sofa.healthcheck.service.SpringContextHealthCheckInfo)1 ArrayList (java.util.ArrayList)1 HealthIndicator (org.springframework.boot.actuate.health.HealthIndicator)1