Search in sources :

Example 1 with AgentHealthHelper

use of org.finos.symphony.toolkit.spring.api.health.AgentHealthHelper in project spring-bot by finos.

the class DefaultApiInstanceFactory method createApiInstance.

@Override
public ApiInstance createApiInstance(SymphonyIdentity id, PodProperties pp, TrustManager[] trustManagers) throws Exception {
    ApiInstance parent = super.createApiInstance(id, pp, trustManagers);
    ApiBuilder agentApiBuilder = ((BasicAPIInstance) parent).agentApiBuilder;
    AgentHealthHelper agentHealth = new AgentHealthHelper(agentApiBuilder);
    HealthCheckingApiInstance out = new HealthCheckingApiInstance(parent, agentHealth);
    if (registry != null) {
        String healthIndicatorName = "symphony-api-" + id.getCommonName() + "-" + pp.getId();
        if (registry.getContributor(healthIndicatorName) == null) {
            registry.registerContributor(healthIndicatorName, out);
        }
    }
    return out;
}
Also used : AgentHealthHelper(org.finos.symphony.toolkit.spring.api.health.AgentHealthHelper) ApiBuilder(com.symphony.api.bindings.ApiBuilder)

Aggregations

ApiBuilder (com.symphony.api.bindings.ApiBuilder)1 AgentHealthHelper (org.finos.symphony.toolkit.spring.api.health.AgentHealthHelper)1