クラス AsyncSupportConfigurer

java.lang.ObjectSE
org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer

public class AsyncSupportConfigurer extends ObjectSE
非同期リクエスト処理のオプションの構成を支援します。
導入:
3.2
作成者:
Rossen Stoyanchev
  • コンストラクターの詳細

    • AsyncSupportConfigurer

      public AsyncSupportConfigurer()
  • メソッドの詳細

    • setTaskExecutor

      public AsyncSupportConfigurer setTaskExecutor(AsyncTaskExecutor taskExecutor)
      提供されたタスクエグゼキューターは次の目的で使用されます。
      1. CallableSE コントローラーメソッドの戻り値を処理します。
      2. リアクティブ(例: Reactor、RxJava)コントローラーメソッドの戻り値を介してレスポンスにストリーミングする場合、ブロッキング書き込みを実行します。

      アプリケーションにそのような戻り値の型を持つコントローラーがある場合は、デフォルトで使用されるコントローラーは負荷がかかる運用には適していないため、AsyncTaskExecutor を構成してください。

      パラメーター:
      taskExecutor - デフォルトで使用するタスクエグゼキューターインスタンス
    • setDefaultTimeout

      public AsyncSupportConfigurer setDefaultTimeout(long timeout)
      非同期リクエスト処理がタイムアウトするまでの時間をミリ秒単位で指定します。Servlet 3 では、タイムアウトは、メインのリクエスト処理スレッドが終了した後に開始され、同時に生成された結果をさらに処理するためにリクエストが再度ディスパッチされると終了します。

      この値が設定されていない場合、基礎となる実装のデフォルトのタイムアウトが使用されます。

      パラメーター:
      timeout - ミリ秒単位のタイムアウト値
    • registerCallableInterceptors

      public AsyncSupportConfigurer registerCallableInterceptors(CallableProcessingInterceptor... interceptors)
      コントローラーが CallableSE を返すときに開始する同時リクエスト実行を中心としたコールバックを使用して、ライフサイクルインターセプターを構成します。
      パラメーター:
      interceptors - 登録するインターセプター
    • registerDeferredResultInterceptors

      public AsyncSupportConfigurer registerDeferredResultInterceptors(DeferredResultProcessingInterceptor... interceptors)
      コントローラーが DeferredResult を返すときに開始する同時リクエスト実行を中心としたコールバックを使用して、ライフサイクルインターセプターを構成します。
      パラメーター:
      interceptors - 登録するインターセプター
    • getTaskExecutor

      @Nullable protected AsyncTaskExecutor getTaskExecutor()
    • getTimeout

      @Nullable protected LongSE getTimeout()
    • getCallableInterceptors

      protected ListSE<CallableProcessingInterceptor> getCallableInterceptors()
    • getDeferredResultInterceptors

      protected ListSE<DeferredResultProcessingInterceptor> getDeferredResultInterceptors()