Class AbstractWebFluxEndpointHandlerMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.reactive.handler.AbstractHandlerMapping
org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping
org.springframework.boot.actuate.endpoint.web.reactive.AbstractWebFluxEndpointHandlerMapping
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.core.Ordered
,org.springframework.web.reactive.HandlerMapping
- Direct Known Subclasses:
AdditionalHealthEndpointPathsWebFluxHandlerMapping
,WebFluxEndpointHandlerMapping
@ImportRuntimeHints(org.springframework.boot.actuate.endpoint.web.reactive.AbstractWebFluxEndpointHandlerMapping.AbstractWebFluxEndpointHandlerMappingRuntimeHints.class)
public abstract class AbstractWebFluxEndpointHandlerMapping
extends org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping
A custom
HandlerMapping
that makes web endpoints available over HTTP using
Spring WebFlux.- Since:
- 2.0.0
-
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, org.springframework.web.cors.CorsConfiguration corsConfiguration, boolean shouldRegisterLinksMapping) Creates a newAbstractWebFluxEndpointHandlerMapping
that provides mappings for the operations of the givenwebEndpoints
. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.web.method.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 org.springframework.web.reactive.result.method.RequestMappingInfo
getMappingForMethod
(Method method, Class<?> handlerType) protected boolean
hasCorsConfigurationSource
(Object handler) protected org.springframework.web.cors.CorsConfiguration
initCorsConfiguration
(Object handler, Method method, org.springframework.web.reactive.result.method.RequestMappingInfo mapping) protected void
protected boolean
protected void
registerReadMapping
(org.springframework.web.reactive.result.method.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, org.springframework.web.cors.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 classorg.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
-
createHandlerMethod
protected org.springframework.web.method.HandlerMethod createHandlerMethod(Object handler, Method method) - Overrides:
createHandlerMethod
in classorg.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
-
registerReadMapping
protected void registerReadMapping(org.springframework.web.reactive.result.method.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 classorg.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
-
initCorsConfiguration
protected org.springframework.web.cors.CorsConfiguration initCorsConfiguration(Object handler, Method method, org.springframework.web.reactive.result.method.RequestMappingInfo mapping) - Overrides:
initCorsConfiguration
in classorg.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
-
isHandler
- Specified by:
isHandler
in classorg.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
-
getMappingForMethod
protected org.springframework.web.reactive.result.method.RequestMappingInfo getMappingForMethod(Method method, Class<?> handlerType) - Specified by:
getMappingForMethod
in classorg.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.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
-