クラス StandardServletAsyncWebRequest
java.lang.ObjectSE
org.springframework.web.context.request.AbstractRequestAttributes
org.springframework.web.context.request.ServletRequestAttributes
org.springframework.web.context.request.ServletWebRequest
org.springframework.web.context.request.async.StandardServletAsyncWebRequest
- 実装されたすべてのインターフェース:
AsyncListenerEE
、EventListenerSE
、AsyncWebRequest
、NativeWebRequest
、RequestAttributes
、WebRequest
public class StandardServletAsyncWebRequest
extends ServletWebRequest
implements AsyncWebRequest, AsyncListenerEE
AsyncWebRequest
のサーブレット実装。 非同期リクエストに含まれるサーブレットとすべてのフィルターは、サーブレット API を使用するか、<async-supported>true</async-supported>
要素をサーブレットに追加して web.xml
のフィルター宣言を有効にして、非同期サポートを有効にする必要があります。
- 導入:
- 3.2
- 作成者:
- Rossen Stoyanchev
フィールドサマリー
クラス org.springframework.web.context.request.ServletRequestAttributes から継承されたフィールド
DESTRUCTION_CALLBACK_NAME_PREFIX, immutableValueTypes
クラス org.springframework.web.context.request.AbstractRequestAttributes から継承されたフィールド
requestDestructionCallbacks
インターフェース org.springframework.web.context.request.RequestAttributes から継承されたフィールド
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_REQUEST, SCOPE_SESSION
コンストラクターのサマリー
コンストラクターコンストラクター説明StandardServletAsyncWebRequest
(HttpServletRequestEE request, HttpServletResponseEE response) 指定されたリクエスト / レスポンスペアの新しいインスタンスを作成します。メソッドのサマリー
修飾子と型メソッド説明void
addCompletionHandler
(RunnableSE runnable) リクエスト処理が完了したときに呼び出すハンドラーを追加します。void
addErrorHandler
(ConsumerSE<ThrowableSE> exceptionHandler) リクエストの同時処理中にエラーが発生したときに呼び出すハンドラーを追加します。void
addTimeoutHandler
(RunnableSE timeoutHandler) 並行処理がタイムアウトしたときに呼び出すハンドラーを追加します。void
dispatch()
アプリケーションスレッドでの同時実行後に処理を再開するために、コンテナーにリクエストをディスパッチします。boolean
非同期リクエスト処理が完了したかどうか。boolean
AsyncWebRequest.startAsync()
の呼び出し後、リクエストが非同期モードかどうか。void
onComplete
(AsyncEventEE event) void
onError
(AsyncEventEE event) void
onStartAsync
(AsyncEventEE event) void
onTimeout
(AsyncEventEE event) void
setTimeout
(LongSE timeout) Servlet 3 非同期処理では、コンテナー処理スレッドが終了した後にタイムアウト期間が始まります。void
非同期リクエスト処理の開始をマークして、メイン処理スレッドが終了したときに、別のスレッドでさらに処理するためにレスポンスが開いたままになるようにします。クラス org.springframework.web.context.request.ServletWebRequest から継承されたメソッド
checkNotModified, checkNotModified, checkNotModified, getContextPath, getDescription, getHeader, getHeaderNames, getHeaderValues, getHttpMethod, getLocale, getNativeRequest, getNativeRequest, getNativeResponse, getNativeResponse, getParameter, getParameterMap, getParameterNames, getParameterValues, getRemoteUser, getUserPrincipal, isNotModified, isSecure, isUserInRole, toString
クラス org.springframework.web.context.request.ServletRequestAttributes から継承されたメソッド
getAttribute, getAttributeNames, getRequest, getResponse, getSession, getSessionId, getSessionMutex, isImmutableSessionAttribute, registerDestructionCallback, registerSessionDestructionCallback, removeAttribute, resolveReference, setAttribute, updateAccessedSessionAttributes
クラス org.springframework.web.context.request.AbstractRequestAttributes から継承されたメソッド
isRequestActive, registerRequestDestructionCallback, removeRequestDestructionCallback, requestCompleted
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSE
インターフェース org.springframework.web.context.request.NativeWebRequest から継承されたメソッド
getNativeRequest, getNativeRequest, getNativeResponse, getNativeResponse
インターフェース org.springframework.web.context.request.RequestAttributes から継承されたメソッド
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute
インターフェース org.springframework.web.context.request.WebRequest から継承されたメソッド
checkNotModified, checkNotModified, checkNotModified, getContextPath, getDescription, getHeader, getHeaderNames, getHeaderValues, getLocale, getParameter, getParameterMap, getParameterNames, getParameterValues, getRemoteUser, getUserPrincipal, isSecure, isUserInRole
コンストラクターの詳細
StandardServletAsyncWebRequest
指定されたリクエスト / レスポンスペアの新しいインスタンスを作成します。- パラメーター:
request
- 現在の HTTP リクエストresponse
- 現在の HTTP レスポンス
メソッドの詳細
setTimeout
Servlet 3 非同期処理では、コンテナー処理スレッドが終了した後にタイムアウト期間が始まります。- 次で指定:
- インターフェース
AsyncWebRequest
のsetTimeout
- パラメーター:
timeout
- ミリ秒単位の時間。null
はタイムアウトがないことを意味します。つまり、コンテナーのデフォルトのタイムアウトに依存します。
addTimeoutHandler
インターフェースからコピーされた説明:AsyncWebRequest
並行処理がタイムアウトしたときに呼び出すハンドラーを追加します。- 次で指定:
- インターフェース
AsyncWebRequest
のaddTimeoutHandler
addErrorHandler
インターフェースからコピーされた説明:AsyncWebRequest
リクエストの同時処理中にエラーが発生したときに呼び出すハンドラーを追加します。- 次で指定:
- インターフェース
AsyncWebRequest
のaddErrorHandler
addCompletionHandler
インターフェースからコピーされた説明:AsyncWebRequest
リクエスト処理が完了したときに呼び出すハンドラーを追加します。- 次で指定:
- インターフェース
AsyncWebRequest
のaddCompletionHandler
isAsyncStarted
public boolean isAsyncStarted()インターフェースからコピーされた説明:AsyncWebRequest
AsyncWebRequest.startAsync()
の呼び出し後、リクエストが非同期モードかどうか。非同期処理が開始されなかった場合、完了した場合、リクエストがさらなる処理のためにディスパッチされた場合、"false" を返します。- 次で指定:
- インターフェース
AsyncWebRequest
のisAsyncStarted
isAsyncComplete
public boolean isAsyncComplete()非同期リクエスト処理が完了したかどうか。非同期処理が完了した後、リクエストオブジェクトとレスポンスオブジェクトの使用を避けることが重要です。サーブレットコンテナーは、しばしば再利用します。
- 次で指定:
- インターフェース
AsyncWebRequest
のisAsyncComplete
startAsync
public void startAsync()インターフェースからコピーされた説明:AsyncWebRequest
非同期リクエスト処理の開始をマークして、メイン処理スレッドが終了したときに、別のスレッドでさらに処理するためにレスポンスが開いたままになるようにします。- 次で指定:
- インターフェース
AsyncWebRequest
のstartAsync
dispatch
public void dispatch()インターフェースからコピーされた説明:AsyncWebRequest
アプリケーションスレッドでの同時実行後に処理を再開するために、コンテナーにリクエストをディスパッチします。- 次で指定:
- インターフェース
AsyncWebRequest
のdispatch
onStartAsync
- 次で指定:
- インターフェース
AsyncListenerEE
のonStartAsyncEE
- 例外:
IOExceptionSE
onTimeout
- 次で指定:
- インターフェース
AsyncListenerEE
のonTimeoutEE
- 例外:
IOExceptionSE
onError
- 次で指定:
- インターフェース
AsyncListenerEE
のonErrorEE
- 例外:
IOExceptionSE
onComplete
- 次で指定:
- インターフェース
AsyncListenerEE
のonCompleteEE
- 例外:
IOExceptionSE