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
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
Modifier and TypeClassDescriptionprotected static final class
AnOperationInvoker
that performs the invocation of a blocking operation on a separate thread using Reactor'sbounded elastic scheduler
.protected static interface
Reactive handler providing actuator links at the root endpoint.protected static interface
A reactive web operation that can be handled by WebFlux. -
Field Summary
Fields inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping
mappingsLogger
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields 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_ATTRIBUTE
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionAbstractWebFluxEndpointHandlerMapping
(EndpointMapping endpointMapping, Collection<ExposableWebEndpoint> endpoints, EndpointMediaTypes endpointMediaTypes, CorsConfiguration corsConfiguration, boolean shouldRegisterLinksMapping) Creates a newAbstractWebFluxEndpointHandlerMapping
that provides mappings for the operations of the givenwebEndpoints
. -
Method Summary
Modifier and TypeMethodDescriptionprotected HandlerMethod
createHandlerMethod
(Object handler, Method method) Return the web endpoints being mapped.protected abstract AbstractWebFluxEndpointHandlerMapping.LinksHandler
Return the Handler providing actuator links at the root endpoint.protected RequestMappingInfo
getMappingForMethod
(Method method, Class<?> handlerType) protected boolean
hasCorsConfigurationSource
(Object handler) protected CorsConfiguration
initCorsConfiguration
(Object handler, Method method, RequestMappingInfo mapping) protected void
protected boolean
protected void
registerReadMapping
(RequestMappingInfo requestMappingInfo, ExposableWebEndpoint endpoint, WebOperation operation) wrapReactiveWebOperation
(ExposableWebEndpoint endpoint, WebOperation operation, AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation reactiveWebOperation) Hook point that allows subclasses to wrap theAbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation
before it's called.Methods inherited from class org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping
getDirectPaths, getHandlerInternal, getMappingComparator, getMatchingMapping, handleMatch, handleNoMatch
Methods inherited from class org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping
afterPropertiesSet, detectHandlerMethods, getCorsConfiguration, getHandlerMethods, handlerMethodsInitialized, lookupHandlerMethod, registerHandlerMethod, registerMapping, unregisterMapping
Methods inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping
formatMappingName, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatch
Methods 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 newAbstractWebFluxEndpointHandlerMapping
that 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:
initHandlerMethods
in classAbstractHandlerMethodMapping<RequestMappingInfo>
-
createHandlerMethod
- Overrides:
createHandlerMethod
in 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.ReactiveWebOperation
before 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:
hasCorsConfigurationSource
in classAbstractHandlerMethodMapping<RequestMappingInfo>
-
initCorsConfiguration
protected CorsConfiguration initCorsConfiguration(Object handler, Method method, RequestMappingInfo mapping) - Overrides:
initCorsConfiguration
in classAbstractHandlerMethodMapping<RequestMappingInfo>
-
isHandler
- Specified by:
isHandler
in classAbstractHandlerMethodMapping<RequestMappingInfo>
-
getMappingForMethod
- Specified by:
getMappingForMethod
in 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
-