Search in sources :

Example 1 with HalJsonMvcEndpoint

use of org.springframework.boot.actuate.endpoint.mvc.HalJsonMvcEndpoint in project spring-boot by spring-projects.

the class CloudFoundryEndpointHandlerMapping method postProcessEndpoints.

@Override
protected void postProcessEndpoints(Set<NamedMvcEndpoint> endpoints) {
    super.postProcessEndpoints(endpoints);
    Iterator<NamedMvcEndpoint> iterator = endpoints.iterator();
    HealthMvcEndpoint healthMvcEndpoint = null;
    while (iterator.hasNext()) {
        NamedMvcEndpoint endpoint = iterator.next();
        if (endpoint instanceof HalJsonMvcEndpoint) {
            iterator.remove();
        } else if (endpoint instanceof HealthMvcEndpoint) {
            iterator.remove();
            healthMvcEndpoint = (HealthMvcEndpoint) endpoint;
        }
    }
    if (healthMvcEndpoint != null) {
        endpoints.add(new CloudFoundryHealthMvcEndpoint(healthMvcEndpoint.getDelegate()));
    }
}
Also used : NamedMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.NamedMvcEndpoint) HalJsonMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.HalJsonMvcEndpoint) HealthMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint)

Aggregations

HalJsonMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.HalJsonMvcEndpoint)1 HealthMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint)1 NamedMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.NamedMvcEndpoint)1