Search in sources :

Example 1 with EndpointExtension

use of org.springframework.boot.actuate.endpoint.annotation.EndpointExtension in project spring-boot by spring-projects.

the class OnAvailableEndpointCondition method getEndpointAnnotation.

protected MergedAnnotation<Endpoint> getEndpointAnnotation(Class<?> target) {
    MergedAnnotations annotations = MergedAnnotations.from(target, SearchStrategy.TYPE_HIERARCHY);
    MergedAnnotation<Endpoint> endpoint = annotations.get(Endpoint.class);
    if (endpoint.isPresent()) {
        return endpoint;
    }
    MergedAnnotation<EndpointExtension> extension = annotations.get(EndpointExtension.class);
    Assert.state(extension.isPresent(), "No endpoint is specified and the return type of the @Bean method is " + "neither an @Endpoint, nor an @EndpointExtension");
    return getEndpointAnnotation(extension.getClass("endpoint"));
}
Also used : EndpointExtension(org.springframework.boot.actuate.endpoint.annotation.EndpointExtension) ExposableEndpoint(org.springframework.boot.actuate.endpoint.ExposableEndpoint) Endpoint(org.springframework.boot.actuate.endpoint.annotation.Endpoint) MergedAnnotations(org.springframework.core.annotation.MergedAnnotations)

Aggregations

ExposableEndpoint (org.springframework.boot.actuate.endpoint.ExposableEndpoint)1 Endpoint (org.springframework.boot.actuate.endpoint.annotation.Endpoint)1 EndpointExtension (org.springframework.boot.actuate.endpoint.annotation.EndpointExtension)1 MergedAnnotations (org.springframework.core.annotation.MergedAnnotations)1