Search in sources :

Example 1 with Component

use of zipkin.Component in project zipkin by openzipkin.

the class RegisterZipkinHealthIndicators method onApplicationEvent.

@Override
public void onApplicationEvent(ApplicationEvent event) {
    if (!(event instanceof ApplicationReadyEvent))
        return;
    ConfigurableListableBeanFactory beanFactory = ((ApplicationReadyEvent) event).getApplicationContext().getBeanFactory();
    ZipkinHealthIndicator healthIndicator = beanFactory.getBean(ZipkinHealthIndicator.class);
    for (Component component : beanFactory.getBeansOfType(Component.class).values()) {
        healthIndicator.addComponent(component);
    }
}
Also used : ApplicationReadyEvent(org.springframework.boot.context.event.ApplicationReadyEvent) Component(zipkin.Component) ConfigurableListableBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)

Aggregations

ConfigurableListableBeanFactory (org.springframework.beans.factory.config.ConfigurableListableBeanFactory)1 ApplicationReadyEvent (org.springframework.boot.context.event.ApplicationReadyEvent)1 Component (zipkin.Component)1