クラス IntegrationRequestMappingHandlerMapping
- 実装済みのインターフェース一覧:
EventListenerSE, Aware, BeanNameAware, InitializingBean, ApplicationContextAware, ApplicationListener<ContextRefreshedEvent>, EmbeddedValueResolverAware, Ordered, ServletContextAware, MatchableHandlerMapping, HandlerMapping
<inbound-channel-adapter/> および <inbound-gateway/> 要素の Spring Integration HTTP 構成から HttpRequestHandlingEndpointSupport の RequestMappingInfo を検出および登録する HandlerMapping 実装。 このクラスは、<inbound-channel-adapter/> および <inbound-gateway/> 要素の解析フェーズ中に、まだ何も登録されていない場合、アプリケーションコンテキストで Bean として自動的に構成されます。ただし、RequestMappingHandlerMapping の適切な構成を使用して、通常の Bean として構成できます。'id' HttpContextUtils.HANDLER_MAPPING_BEAN_NAME を使用して、アプリケーションコンテキスト内に同様の Bean を 1 つだけ持つことをお勧めします。
ほとんどの場合、Spring MVC は org.springframework.stereotype.Controller および RequestMapping を介してリクエストマッピングを構成することを提案します。これが、Spring MVC のハンドラーマッピングインフラストラクチャが HandlerMethod に依存している理由です。同じ org.springframework.stereotype.Controller ユーザークラスの異なるメソッドが独自の RequestMapping を持つ場合があるためです。一方、すべての Spring Integration HTTP 受信 エンドポイントは、同じ BaseHttpInboundEndpoint クラスに基づいて構成されており、Spring MVC に HandlerMethod がない単一の RequestMappingInfo 構成はありません。IntegrationRequestMappingHandlerMapping は、メソッドレベルのアノテーションとコンポーネントレベル (Spring Integration XML など) の構成の間の HandlerMapping 妥協の実装です。
このクラスは Spring MVC RequestMappingHandlerMapping クラスを継承し、そのロジックのほとんど、特に RequestMappingInfoHandlerMapping.handleNoMatch(java.util.Set, String, HttpServletRequest) を継承します。これは、何らかの理由でマッピングが一致しない場合に HTTP レスポンスに対して特定の 4xx エラーをスローし、アプリケーションコンテキスト内の残りのマッピングハンドラーへの呼び出しを防ぎます。このため、Spring Integration と Spring MVC の両方のリクエストマッピングに同じパスを設定することはサポートされていません(たとえば、一方に `POST`、もう一方に `GET`)。MVC マッピングは見つかりません。
- 導入:
- 3.0
- 作成者:
- Artem Bilan, Gary Russell
- 関連事項:
フィールド概要
クラス AbstractHandlerMapping から継承されたフィールド
mappingsLoggerクラス ApplicationObjectSupport から継承されたフィールド
loggerインターフェース HandlerMapping から継承されたフィールド
API_VERSION_ATTRIBUTE, BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, LOOKUP_PATH, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEインターフェース Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明voidprotected voiddetectHandlerMethods(ObjectSE handlerArg) protected @Nullable CorsConfigurationgetCorsConfiguration(ObjectSE handler, HttpServletRequestEE request) protected HandlerExecutionChaingetHandlerExecutionChain(ObjectSE handlerArg, HttpServletRequestEE request) protected @Nullable CorsConfigurationinitCorsConfiguration(ObjectSE handler, MethodSE method, RequestMappingInfo mappingInfo) protected booleanvoidHttpRequestHandlingEndpointSupportは自動作成されたrequestChannelに依存する可能性があるため、MVC ハンドラーの検出は可能な限り遅く延期する必要があります。クラス RequestMappingHandlerMapping から継承されたメソッド
createRequestMappingInfo, createRequestMappingInfo, getBuilderConfiguration, getContentNegotiationManager, getCustomMethodCondition, getCustomTypeCondition, getMappingForMethod, getPathPrefixes, match, registerHandlerMethod, registerMapping, resolveEmbeddedValuesInPatterns, setContentNegotiationManager, setEmbeddedValueResolver, setPathPrefixesクラス RequestMappingInfoHandlerMapping から継承されたメソッド
getDirectPaths, getHandlerInternal, getMappingComparator, getMatchingMapping, handleMatch, handleNoMatchクラス AbstractHandlerMethodMapping から継承されたメソッド
createHandlerMethod, getCandidateBeanNames, getHandlerMethods, getHandlerMethodsForMappingName, getNamingStrategy, handlerMethodsInitialized, hasCorsConfigurationSource, initHandlerMethods, lookupHandlerMethod, processCandidateBean, setDetectHandlerMethodsInAncestorContexts, setHandlerMethodMappingNamingStrategy, setPatternParser, unregisterMappingクラス AbstractHandlerMapping から継承されたメソッド
adaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getApiVersionStrategy, getCorsConfigurationSource, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getMappedInterceptors, getOrder, getPathMatcher, getPatternParser, getUrlPathHelper, initApplicationContext, initInterceptors, initLookupPath, setAlwaysUseFullPath, setApiVersionStrategy, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper, usesPathPatternsクラス WebApplicationObjectSupport から継承されたメソッド
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextクラス ApplicationObjectSupport から継承されたメソッド
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContextクラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース ApplicationListener から継承されたメソッド
supportsAsyncExecutionインターフェース HandlerMapping から継承されたメソッド
getHandler, usesPathPatternsインターフェース MatchableHandlerMapping から継承されたメソッド
getPatternParser
コンストラクターの詳細
IntegrationRequestMappingHandlerMapping
public IntegrationRequestMappingHandlerMapping()
方法の詳細
isHandler
- オーバーライド:
- クラス
RequestMappingHandlerMappingのisHandler
getHandlerExecutionChain
protected HandlerExecutionChain getHandlerExecutionChain(ObjectSE handlerArg, HttpServletRequestEE request) - オーバーライド:
- クラス
AbstractHandlerMappingのgetHandlerExecutionChain
getCorsConfiguration
protected @Nullable CorsConfiguration getCorsConfiguration(ObjectSE handler, HttpServletRequestEE request) - オーバーライド:
- クラス
AbstractHandlerMethodMapping<RequestMappingInfo>のgetCorsConfiguration
detectHandlerMethods
- オーバーライド:
- クラス
AbstractHandlerMethodMapping<RequestMappingInfo>のdetectHandlerMethods
initCorsConfiguration
protected @Nullable CorsConfiguration initCorsConfiguration(ObjectSE handler, MethodSE method, RequestMappingInfo mappingInfo) - オーバーライド:
- クラス
RequestMappingHandlerMappingのinitCorsConfiguration
onApplicationEvent
HttpRequestHandlingEndpointSupportは自動作成されたrequestChannelに依存する可能性があるため、MVC ハンドラーの検出は可能な限り遅く延期する必要があります。- 次で指定:
- インターフェース
ApplicationListener<ContextRefreshedEvent>内のonApplicationEvent - 関連事項:
afterPropertiesSet
public void afterPropertiesSet()- 次で指定:
- インターフェース
InitializingBean内のafterPropertiesSet - オーバーライド:
- クラス
RequestMappingHandlerMappingのafterPropertiesSet