public class DispatcherHandler extends ObjectSE implements WebHandler, ApplicationContextAware
DispatcherHandler
は、Spring 構成から必要なデリゲートコンポーネントを検出します。アプリケーションコンテキストで次を検出します。
HandlerMapping
-- リクエストをハンドラーオブジェクトにマップする HandlerAdapter
-- 任意のハンドラーインターフェースを使用するため HandlerResultHandler
-- プロセスハンドラーの戻り値 DispatcherHandler
は、それ自体が Spring Bean となるように設計されており、実行されるコンテキストにアクセスするために ApplicationContextAware
を実装しています。DispatcherHandler
が Bean 名 "webHandler" で宣言されている場合、WebHttpHandlerBuilder.applicationContext(org.springframework.context.ApplicationContext)
によって検出され、WebFilter
、WebExceptionHandler
などとともに処理 チェーンが作成されます。
@EnableWebFlux
構成には、DispatcherHandler
Bean 宣言が含まれています。
WebHttpHandlerBuilder.applicationContext(ApplicationContext)
コンストラクターと説明 |
---|
DispatcherHandler() ApplicationContext から setApplicationContext(org.springframework.context.ApplicationContext) で構成する必要がある新しい DispatcherHandler を作成します。 |
DispatcherHandler(ApplicationContext applicationContext) 指定された ApplicationContext の新しい DispatcherHandler を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
ListSE<HandlerMapping> | getHandlerMappings() |
reactor.core.publisher.Mono<VoidSE> | handle(ServerWebExchange exchange) Web サーバー交換を処理します。 |
protected void | initStrategies(ApplicationContext context) |
void | setApplicationContext(ApplicationContext applicationContext) このオブジェクトが実行される ApplicationContext を設定します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public DispatcherHandler()
ApplicationContext
から setApplicationContext(org.springframework.context.ApplicationContext)
で構成する必要がある新しい DispatcherHandler
を作成します。public DispatcherHandler(ApplicationContext applicationContext)
ApplicationContext
の新しい DispatcherHandler
を作成します。applicationContext
- ハンドラー Bean を見つけるためのアプリケーションコンテキスト @Nullable public final ListSE<HandlerMapping> getHandlerMappings()
injected context
および sorted
の型によって検出されたすべての HandlerMapping
Bean を返します。 注意 : setApplicationContext(ApplicationContext)
の前に呼び出された場合、このメソッドは null
を返すことがあります。
null
を含む不変リスト public void setApplicationContext(ApplicationContext applicationContext)
ApplicationContextAware
通常の Bean プロパティの設定後、ただし InitializingBean.afterPropertiesSet()
またはカスタム init メソッドなどの init コールバックの前に呼び出されます。ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
、ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
および MessageSourceAware
の後に呼び出されます(該当する場合)。
ApplicationContextAware
の setApplicationContext
applicationContext
- このオブジェクトによって使用される ApplicationContext オブジェクト BeanInitializationException
protected void initStrategies(ApplicationContext context)
public reactor.core.publisher.Mono<VoidSE> handle(ServerWebExchange exchange)
WebHandler
WebHandler
の handle
exchange
- 現在のサーバー交換 Mono<Void>