Class AbstractWebFluxEndpointHandlerMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.reactive.handler.AbstractHandlerMapping
org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<RequestMappingInfo>
org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping
org.springframework.boot.webflux.actuate.endpoint.web.AbstractWebFluxEndpointHandlerMapping
- All Implemented Interfaces:
Aware, BeanNameAware, InitializingBean, ApplicationContextAware, Ordered, HandlerMapping
- Direct Known Subclasses:
AdditionalHealthEndpointPathsWebFluxHandlerMapping, WebFluxEndpointHandlerMapping
@ImportRuntimeHints(org.springframework.boot.webflux.actuate.endpoint.web.AbstractWebFluxEndpointHandlerMapping.AbstractWebFluxEndpointHandlerMappingRuntimeHints.class)
public abstract class AbstractWebFluxEndpointHandlerMapping
extends RequestMappingInfoHandlerMapping
A custom
HandlerMapping that makes web endpoints available over HTTP using
Spring WebFlux.- Since:
- 4.0.0
- Author:
- Andy Wilkinson, Madhura Bhave, Phillip Webb, Brian Clozel, Scott Frederick
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classAnOperationInvokerthat performs the invocation of a blocking operation on a separate thread using Reactor'sbounded elastic scheduler.protected static final classprotected static interfaceReactive handler providing actuator links at the root endpoint.protected static interfaceA reactive web operation that can be handled by WebFlux. -
Field Summary
Fields inherited from class AbstractHandlerMapping
mappingsLoggerFields inherited from class ApplicationObjectSupport
loggerFields inherited from interface HandlerMapping
API_VERSION_ATTRIBUTE, BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEFields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionAbstractWebFluxEndpointHandlerMapping(EndpointMapping endpointMapping, Collection<ExposableWebEndpoint> endpoints, EndpointMediaTypes endpointMediaTypes, @Nullable CorsConfiguration corsConfiguration, boolean shouldRegisterLinksMapping) Creates a newAbstractWebFluxEndpointHandlerMappingthat provides mappings for the operations of the givenwebEndpoints. -
Method Summary
Modifier and TypeMethodDescriptionprotected HandlerMethodcreateHandlerMethod(Object handler, Method method) protected @Nullable CorsConfigurationgetCorsConfiguration(Object handler, ServerWebExchange exchange) Return the web endpoints being mapped.protected abstract AbstractWebFluxEndpointHandlerMapping.LinksHandlerReturn the Handler providing actuator links at the root endpoint.protected @Nullable RequestMappingInfogetMappingForMethod(Method method, Class<?> handlerType) protected booleanhasCorsConfigurationSource(Object handler) protected @Nullable CorsConfigurationinitCorsConfiguration(Object handler, Method method, RequestMappingInfo mapping) protected voidprotected booleanprotected voidregisterReadMapping(RequestMappingInfo requestMappingInfo, ExposableWebEndpoint endpoint, WebOperation operation) wrapReactiveWebOperation(ExposableWebEndpoint endpoint, WebOperation operation, AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation reactiveWebOperation) Hook point that allows subclasses to wrap theAbstractWebFluxEndpointHandlerMapping.ReactiveWebOperationbefore it's called.Methods inherited from class RequestMappingInfoHandlerMapping
getDirectPaths, getHandlerInternal, getMappingComparator, getMatchingMapping, handleMatch, handleNoMatchMethods inherited from class AbstractHandlerMethodMapping
afterPropertiesSet, detectHandlerMethods, getHandlerMethods, handlerMethodsInitialized, lookupHandlerMethod, registerHandlerMethod, registerMapping, unregisterMappingMethods inherited from class AbstractHandlerMapping
formatMappingName, getApiVersionStrategy, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setApiVersionStrategy, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch
-
Constructor Details
-
AbstractWebFluxEndpointHandlerMapping
public AbstractWebFluxEndpointHandlerMapping(EndpointMapping endpointMapping, Collection<ExposableWebEndpoint> endpoints, EndpointMediaTypes endpointMediaTypes, @Nullable CorsConfiguration corsConfiguration, boolean shouldRegisterLinksMapping) Creates a newAbstractWebFluxEndpointHandlerMappingthat provides mappings for the operations of the givenwebEndpoints.- Parameters:
endpointMapping- the base mapping for all endpointsendpoints- the web endpointsendpointMediaTypes- media types consumed and produced by the endpointscorsConfiguration- the CORS configuration for the endpointsshouldRegisterLinksMapping- whether the links endpoint should be registered
-
-
Method Details
-
initHandlerMethods
protected void initHandlerMethods()- Overrides:
initHandlerMethodsin classAbstractHandlerMethodMapping<RequestMappingInfo>
-
createHandlerMethod
- Overrides:
createHandlerMethodin classAbstractHandlerMethodMapping<RequestMappingInfo>
-
registerReadMapping
protected void registerReadMapping(RequestMappingInfo requestMappingInfo, ExposableWebEndpoint endpoint, WebOperation operation) -
wrapReactiveWebOperation
protected AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation wrapReactiveWebOperation(ExposableWebEndpoint endpoint, WebOperation operation, AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation reactiveWebOperation) Hook point that allows subclasses to wrap theAbstractWebFluxEndpointHandlerMapping.ReactiveWebOperationbefore it's called. Allows additional features, such as security, to be added.- Parameters:
endpoint- the source endpointoperation- the source operationreactiveWebOperation- the reactive web operation to wrap- Returns:
- a wrapped reactive web operation
-
hasCorsConfigurationSource
- Overrides:
hasCorsConfigurationSourcein classAbstractHandlerMethodMapping<RequestMappingInfo>
-
initCorsConfiguration
protected @Nullable CorsConfiguration initCorsConfiguration(Object handler, Method method, RequestMappingInfo mapping) - Overrides:
initCorsConfigurationin classAbstractHandlerMethodMapping<RequestMappingInfo>
-
getCorsConfiguration
protected @Nullable CorsConfiguration getCorsConfiguration(Object handler, ServerWebExchange exchange) - Overrides:
getCorsConfigurationin classAbstractHandlerMethodMapping<RequestMappingInfo>
-
isHandler
- Specified by:
isHandlerin classAbstractHandlerMethodMapping<RequestMappingInfo>
-
getMappingForMethod
- Specified by:
getMappingForMethodin classAbstractHandlerMethodMapping<RequestMappingInfo>
-
getLinksHandler
Return the Handler providing actuator links at the root endpoint.- Returns:
- the links handler
-
getEndpoints
Return the web endpoints being mapped.- Returns:
- the endpoints
-