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.actuate.endpoint.web.reactive.AbstractWebFluxEndpointHandlerMapping
- All Implemented Interfaces:
Aware,BeanNameAware,InitializingBean,ApplicationContextAware,Ordered,HandlerMapping
- Direct Known Subclasses:
AdditionalHealthEndpointPathsWebFluxHandlerMapping,WebFluxEndpointHandlerMapping
@ImportRuntimeHints(org.springframework.boot.actuate.endpoint.web.reactive.AbstractWebFluxEndpointHandlerMapping.AbstractWebFluxEndpointHandlerMappingRuntimeHints.class)
public abstract class AbstractWebFluxEndpointHandlerMapping
extends RequestMappingInfoHandlerMapping
A custom
HandlerMapping that makes web endpoints available over HTTP using
Spring WebFlux.- Since:
- 2.0.0
- Author:
- Andy Wilkinson, Madhura Bhave, Phillip Webb, Brian Clozel
-
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 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 org.springframework.web.reactive.handler.AbstractHandlerMapping
mappingsLoggerFields inherited from class org.springframework.context.support.ApplicationObjectSupport
loggerFields inherited from interface org.springframework.web.reactive.HandlerMapping
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 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionAbstractWebFluxEndpointHandlerMapping(EndpointMapping endpointMapping, Collection<ExposableWebEndpoint> endpoints, EndpointMediaTypes endpointMediaTypes, 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) Return the web endpoints being mapped.protected abstract AbstractWebFluxEndpointHandlerMapping.LinksHandlerReturn the Handler providing actuator links at the root endpoint.protected RequestMappingInfogetMappingForMethod(Method method, Class<?> handlerType) protected booleanhasCorsConfigurationSource(Object handler) protected 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 org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping
getDirectPaths, getHandlerInternal, getMappingComparator, getMatchingMapping, handleMatch, handleNoMatchMethods inherited from class org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping
afterPropertiesSet, detectHandlerMethods, getCorsConfiguration, getHandlerMethods, handlerMethodsInitialized, lookupHandlerMethod, registerHandlerMethod, registerMapping, unregisterMappingMethods inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping
formatMappingName, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatchMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Constructor Details
-
AbstractWebFluxEndpointHandlerMapping
public AbstractWebFluxEndpointHandlerMapping(EndpointMapping endpointMapping, Collection<ExposableWebEndpoint> endpoints, EndpointMediaTypes endpointMediaTypes, 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 CorsConfiguration initCorsConfiguration(Object handler, Method method, RequestMappingInfo mapping) - Overrides:
initCorsConfigurationin 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
-