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.webflux.actuate.endpoint.web.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.webflux.actuate.endpoint.web.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:
4.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static final class 
    An OperationInvoker that performs the invocation of a blocking operation on a separate thread using Reactor's bounded elastic scheduler.
    protected static final class 
     
    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

    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_ATTRIBUTE

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractWebFluxEndpointHandlerMapping(org.springframework.boot.actuate.endpoint.web.EndpointMapping endpointMapping, Collection<org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint> endpoints, org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes endpointMediaTypes, @Nullable org.springframework.web.cors.CorsConfiguration corsConfiguration, boolean shouldRegisterLinksMapping)
    Creates a new AbstractWebFluxEndpointHandlerMapping that provides mappings for the operations of the given webEndpoints.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.web.method.HandlerMethod
    createHandlerMethod(Object handler, Method method)
     
    protected @Nullable org.springframework.web.cors.CorsConfiguration
    getCorsConfiguration(Object handler, org.springframework.web.server.ServerWebExchange exchange)
     
    Collection<org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint>
    Return the web endpoints being mapped.
    Return the Handler providing actuator links at the root endpoint.
    protected @Nullable org.springframework.web.reactive.result.method.RequestMappingInfo
    getMappingForMethod(Method method, Class<?> handlerType)
     
    protected boolean
     
    protected @Nullable org.springframework.web.cors.CorsConfiguration
    initCorsConfiguration(Object handler, Method method, org.springframework.web.reactive.result.method.RequestMappingInfo mapping)
     
    protected void
     
    protected boolean
    isHandler(Class<?> beanType)
     
    protected void
    registerReadMapping(org.springframework.web.reactive.result.method.RequestMappingInfo requestMappingInfo, org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint endpoint, org.springframework.boot.actuate.endpoint.web.WebOperation operation)
     
    wrapReactiveWebOperation(org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint endpoint, org.springframework.boot.actuate.endpoint.web.WebOperation operation, AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation reactiveWebOperation)
    Hook point that allows subclasses to wrap the AbstractWebFluxEndpointHandlerMapping.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, getHandlerMethods, handlerMethodsInitialized, lookupHandlerMethod, registerHandlerMethod, registerMapping, unregisterMapping

    Methods inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping

    formatMappingName, getApiVersionStrategy, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setApiVersionStrategy, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch

    Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

    getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractWebFluxEndpointHandlerMapping

      public AbstractWebFluxEndpointHandlerMapping(org.springframework.boot.actuate.endpoint.web.EndpointMapping endpointMapping, Collection<org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint> endpoints, org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes endpointMediaTypes, @Nullable org.springframework.web.cors.CorsConfiguration corsConfiguration, boolean shouldRegisterLinksMapping)
      Creates a new AbstractWebFluxEndpointHandlerMapping that provides mappings for the operations of the given webEndpoints.
      Parameters:
      endpointMapping - the base mapping for all endpoints
      endpoints - the web endpoints
      endpointMediaTypes - media types consumed and produced by the endpoints
      corsConfiguration - the CORS configuration for the endpoints
      shouldRegisterLinksMapping - whether the links endpoint should be registered
  • Method Details

    • initHandlerMethods

      protected void initHandlerMethods()
      Overrides:
      initHandlerMethods in class org.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 class org.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, org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint endpoint, org.springframework.boot.actuate.endpoint.web.WebOperation operation)
    • wrapReactiveWebOperation

      protected AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation wrapReactiveWebOperation(org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint endpoint, org.springframework.boot.actuate.endpoint.web.WebOperation operation, AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation reactiveWebOperation)
      Hook point that allows subclasses to wrap the AbstractWebFluxEndpointHandlerMapping.ReactiveWebOperation before it's called. Allows additional features, such as security, to be added.
      Parameters:
      endpoint - the source endpoint
      operation - the source operation
      reactiveWebOperation - the reactive web operation to wrap
      Returns:
      a wrapped reactive web operation
    • hasCorsConfigurationSource

      protected boolean hasCorsConfigurationSource(Object handler)
      Overrides:
      hasCorsConfigurationSource in class org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
    • initCorsConfiguration

      protected @Nullable org.springframework.web.cors.CorsConfiguration initCorsConfiguration(Object handler, Method method, org.springframework.web.reactive.result.method.RequestMappingInfo mapping)
      Overrides:
      initCorsConfiguration in class org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
    • getCorsConfiguration

      protected @Nullable org.springframework.web.cors.CorsConfiguration getCorsConfiguration(Object handler, org.springframework.web.server.ServerWebExchange exchange)
      Overrides:
      getCorsConfiguration in class org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
    • isHandler

      protected boolean isHandler(Class<?> beanType)
      Specified by:
      isHandler in class org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<org.springframework.web.reactive.result.method.RequestMappingInfo>
    • getMappingForMethod

      protected @Nullable org.springframework.web.reactive.result.method.RequestMappingInfo getMappingForMethod(Method method, Class<?> handlerType)
      Specified by:
      getMappingForMethod in class org.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<org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint> getEndpoints()
      Return the web endpoints being mapped.
      Returns:
      the endpoints