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:
WebFluxEndpointHandlerMapping
public abstract class AbstractWebFluxEndpointHandlerMapping extends org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping
A customHandlerMapping
that makes web endpoints available over HTTP using Spring WebFlux.- Since:
- 2.0.0
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractWebFluxEndpointHandlerMapping.ElasticSchedulerInvoker
AnOperationInvoker
that performs the invocation of a blocking operation on a separate thread using Reactor'selastic scheduler
.protected static interface
AbstractWebFluxEndpointHandlerMapping.LinksHandler
Reactive handler providing actuator links at the root endpoint.protected static interface
AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation
A reactive web operation that can be handled by WebFlux.
Constructor Summary
Constructors Constructor Description AbstractWebFluxEndpointHandlerMapping(EndpointMapping endpointMapping, Collection<ExposableWebEndpoint> endpoints, EndpointMediaTypes endpointMediaTypes, org.springframework.web.cors.CorsConfiguration corsConfiguration)
Creates a newAbstractWebFluxEndpointHandlerMapping
that provides mappings for the operations of the givenwebEndpoints
.
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.springframework.web.method.HandlerMethod
createHandlerMethod(Object handler, Method method)
Collection<ExposableWebEndpoint>
getEndpoints()
Return the web endpoints being mapped.protected abstract AbstractWebFluxEndpointHandlerMapping.LinksHandler
getLinksHandler()
Return the Handler providing actuator links at the root endpoint.protected org.springframework.web.reactive.result.method.RequestMappingInfo
getMappingForMethod(Method method, Class<?> handlerType)
protected org.springframework.web.cors.CorsConfiguration
initCorsConfiguration(Object handler, Method method, org.springframework.web.reactive.result.method.RequestMappingInfo mapping)
protected void
initHandlerMethods()
protected boolean
isHandler(Class<?> beanType)
protected AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation
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
getMappingComparator, getMatchingMapping, handleMatch, handleNoMatch
Methods inherited from class org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping
afterPropertiesSet, detectHandlerMethods, getCorsConfiguration, getHandlerInternal, 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
Constructor Detail
AbstractWebFluxEndpointHandlerMapping
public AbstractWebFluxEndpointHandlerMapping(EndpointMapping endpointMapping, Collection<ExposableWebEndpoint> endpoints, EndpointMediaTypes endpointMediaTypes, org.springframework.web.cors.CorsConfiguration corsConfiguration)
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 endpoints
Method Detail
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>
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
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
protected boolean isHandler(Class<?> beanType)
- 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
protected abstract AbstractWebFluxEndpointHandlerMapping.LinksHandler getLinksHandler()
Return the Handler providing actuator links at the root endpoint.- Returns:
- the links handler
getEndpoints
public Collection<ExposableWebEndpoint> getEndpoints()
Return the web endpoints being mapped.- Returns:
- the endpoints