public class WebFluxIntegrationRequestMappingHandlerMapping extends RequestMappingHandlerMapping implements ApplicationListener<ContextRefreshedEvent>, DestructionAwareBeanPostProcessor
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.
RequestMapping,
RequestMappingHandlerMappingloggerBEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
WebFluxIntegrationRequestMappingHandlerMapping() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
detectHandlerMethods(Object handler) |
protected CorsConfiguration |
initCorsConfiguration(Object handler,
Method method,
RequestMappingInfo mappingInfo) |
protected boolean |
isHandler(Class<?> beanType) |
void |
onApplicationEvent(ContextRefreshedEvent event)
HttpRequestHandlingEndpointSupports
may depend on auto-created requestChannels, so MVC Handlers detection should be postponed
as late as possible. |
void |
postProcessBeforeDestruction(Object bean,
String beanName) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
boolean |
requiresDestruction(Object bean) |
createRequestMappingInfo, getContentTypeResolver, getCustomMethodCondition, getCustomTypeCondition, getMappingForMethod, getPathPrefixes, registerHandlerMethod, registerMapping, resolveEmbeddedValuesInPatterns, setContentTypeResolver, setEmbeddedValueResolver, setPathPrefixesgetDirectPaths, getHandlerInternal, getMappingComparator, getMatchingMapping, handleMatch, handleNoMatchcreateHandlerMethod, getCorsConfiguration, getHandlerMethods, handlerMethodsInitialized, hasCorsConfigurationSource, initHandlerMethods, lookupHandlerMethod, unregisterMappingformatMappingName, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatchgetApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforPayloadpostProcessAfterInitializationpublic WebFluxIntegrationRequestMappingHandlerMapping()
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException
postProcessBeforeInitialization in interface BeanPostProcessorBeansExceptionpublic void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException
postProcessBeforeDestruction in interface DestructionAwareBeanPostProcessorBeansExceptionpublic boolean requiresDestruction(Object bean)
requiresDestruction in interface DestructionAwareBeanPostProcessorprotected boolean isHandler(Class<?> beanType)
isHandler in class RequestMappingHandlerMappingprotected void detectHandlerMethods(Object handler)
detectHandlerMethods in class AbstractHandlerMethodMapping<RequestMappingInfo>protected CorsConfiguration initCorsConfiguration(Object handler, Method method, RequestMappingInfo mappingInfo)
initCorsConfiguration in class RequestMappingHandlerMappingpublic void onApplicationEvent(ContextRefreshedEvent event)
HttpRequestHandlingEndpointSupports
may depend on auto-created requestChannels, so MVC Handlers detection should be postponed
as late as possible.onApplicationEvent in interface ApplicationListener<ContextRefreshedEvent>RequestMappingHandlerMapping.afterPropertiesSet()public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanafterPropertiesSet in class RequestMappingHandlerMapping