Class WebFluxIntegrationRequestMappingHandlerMapping
- All Implemented Interfaces:
- EventListener,- Aware,- BeanNameAware,- BeanPostProcessor,- DestructionAwareBeanPostProcessor,- InitializingBean,- ApplicationContextAware,- ApplicationListener<ContextRefreshedEvent>,- EmbeddedValueResolverAware,- Ordered,- HandlerMapping
HandlerMapping implementation that
 detects and registers RequestMappingInfos for
 HttpRequestHandlingEndpointSupport
 from a Spring Integration HTTP configuration
 of <inbound-channel-adapter/> and <inbound-gateway/> elements.
 
 This class is automatically configured as a bean in the application context during the
 parsing phase of the <inbound-gateway/>
 elements, if there is none registered, yet. However it can be configured as a regular
 bean with appropriate configuration for
 RequestMappingHandlerMapping.
 It is recommended to have only one similar bean in the application context using the 'id'
 WebFluxContextUtils.HANDLER_MAPPING_BEAN_NAME.
 
 In most cases, Spring MVC offers to configure Request Mapping via
 org.springframework.stereotype.Controller and
 RequestMapping.
 That's why Spring MVC's Handler Mapping infrastructure relies on
 HandlerMethod, as different methods at the same
 org.springframework.stereotype.Controller user-class may have their own
 RequestMapping.
 On the other side, all Spring Integration HTTP Inbound Endpoints are configured on
 the basis of the same HttpRequestHandlingEndpointSupport
 class and there is no single RequestMappingInfo
 configuration without HandlerMethod in Spring MVC.
 Accordingly WebFluxIntegrationRequestMappingHandlerMapping is a
 HandlerMapping
 compromise implementation between method-level annotations and component-level
 (e.g. Spring Integration XML) configurations.
 
 Starting with version 5.1, this class implements DestructionAwareBeanPostProcessor to
 register HTTP endpoints at runtime for dynamically declared beans, e.g. via
 IntegrationFlowContext, and unregister
 them during the WebFluxInboundEndpoint destruction.
- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell, Ngoc Nhan
- See Also:
- 
Field SummaryFields inherited from class org.springframework.web.reactive.handler.AbstractHandlerMappingmappingsLoggerFields inherited from class org.springframework.context.support.ApplicationObjectSupportloggerFields inherited from interface org.springframework.web.reactive.HandlerMappingBEST_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.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidprotected voiddetectHandlerMethods(Object handler) protected CorsConfigurationinitCorsConfiguration(Object handler, Method method, RequestMappingInfo mappingInfo) protected booleanvoidHttpRequestHandlingEndpointSupports may depend on auto-createdrequestChannels, so MVC Handlers detection should be postponed as late as possible.voidpostProcessBeforeDestruction(Object bean, String beanName) postProcessBeforeInitialization(Object bean, String beanName) booleanrequiresDestruction(Object bean) Methods inherited from class org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMappingcreateRequestMappingInfo, createRequestMappingInfo, getContentTypeResolver, getCustomMethodCondition, getCustomTypeCondition, getMappingForMethod, getPathPrefixes, registerHandlerMethod, registerMapping, resolveEmbeddedValuesInPatterns, setContentTypeResolver, setEmbeddedValueResolver, setPathPrefixesMethods inherited from class org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMappinggetDirectPaths, getHandlerInternal, getMappingComparator, getMatchingMapping, handleMatch, handleNoMatchMethods inherited from class org.springframework.web.reactive.result.method.AbstractHandlerMethodMappingcreateHandlerMethod, getCorsConfiguration, getHandlerMethods, handlerMethodsInitialized, hasCorsConfigurationSource, initHandlerMethods, lookupHandlerMethod, unregisterMappingMethods inherited from class org.springframework.web.reactive.handler.AbstractHandlerMappingformatMappingName, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatchMethods inherited from class org.springframework.context.support.ApplicationObjectSupportgetApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContextMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListenersupportsAsyncExecutionMethods inherited from interface org.springframework.beans.factory.config.BeanPostProcessorpostProcessAfterInitialization
- 
Constructor Details- 
WebFluxIntegrationRequestMappingHandlerMappingpublic WebFluxIntegrationRequestMappingHandlerMapping()
 
- 
- 
Method Details- 
postProcessBeforeInitialization- Specified by:
- postProcessBeforeInitializationin interface- BeanPostProcessor
- Throws:
- BeansException
 
- 
postProcessBeforeDestruction- Specified by:
- postProcessBeforeDestructionin interface- DestructionAwareBeanPostProcessor
- Throws:
- BeansException
 
- 
requiresDestruction- Specified by:
- requiresDestructionin interface- DestructionAwareBeanPostProcessor
 
- 
isHandler- Overrides:
- isHandlerin class- RequestMappingHandlerMapping
 
- 
detectHandlerMethods- Overrides:
- detectHandlerMethodsin class- AbstractHandlerMethodMapping<RequestMappingInfo>
 
- 
initCorsConfigurationprotected CorsConfiguration initCorsConfiguration(Object handler, Method method, RequestMappingInfo mappingInfo) - Overrides:
- initCorsConfigurationin class- RequestMappingHandlerMapping
 
- 
onApplicationEventHttpRequestHandlingEndpointSupports may depend on auto-createdrequestChannels, so MVC Handlers detection should be postponed as late as possible.- Specified by:
- onApplicationEventin interface- ApplicationListener<ContextRefreshedEvent>
- See Also:
 
- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- InitializingBean
- Overrides:
- afterPropertiesSetin class- RequestMappingHandlerMapping
 
 
-