Search in sources :

Example 1 with WebFluxEndpointHandlerMapping

use of org.springframework.boot.actuate.endpoint.web.reactive.WebFluxEndpointHandlerMapping in project spring-boot by spring-projects.

the class WebFluxEndpointManagementContextConfiguration method webEndpointReactiveHandlerMapping.

@Bean
@ConditionalOnMissingBean
public WebFluxEndpointHandlerMapping webEndpointReactiveHandlerMapping(WebEndpointsSupplier webEndpointsSupplier, ControllerEndpointsSupplier controllerEndpointsSupplier, EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties, Environment environment) {
    String basePath = webEndpointProperties.getBasePath();
    EndpointMapping endpointMapping = new EndpointMapping(basePath);
    Collection<ExposableWebEndpoint> endpoints = webEndpointsSupplier.getEndpoints();
    List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
    allEndpoints.addAll(endpoints);
    allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
    return new WebFluxEndpointHandlerMapping(endpointMapping, endpoints, endpointMediaTypes, corsProperties.toCorsConfiguration(), new EndpointLinksResolver(allEndpoints, basePath), shouldRegisterLinksMapping(webEndpointProperties, environment, basePath));
}
Also used : ExposableWebEndpoint(org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint) ExposableEndpoint(org.springframework.boot.actuate.endpoint.ExposableEndpoint) ArrayList(java.util.ArrayList) WebFluxEndpointHandlerMapping(org.springframework.boot.actuate.endpoint.web.reactive.WebFluxEndpointHandlerMapping) EndpointLinksResolver(org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver) EndpointMapping(org.springframework.boot.actuate.endpoint.web.EndpointMapping) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ArrayList (java.util.ArrayList)1 ExposableEndpoint (org.springframework.boot.actuate.endpoint.ExposableEndpoint)1 EndpointLinksResolver (org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver)1 EndpointMapping (org.springframework.boot.actuate.endpoint.web.EndpointMapping)1 ExposableWebEndpoint (org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint)1 WebFluxEndpointHandlerMapping (org.springframework.boot.actuate.endpoint.web.reactive.WebFluxEndpointHandlerMapping)1 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1