public class MockAsyncContext extends ObjectSE implements AsyncContextEE
AsyncContext
EE インターフェースのモック実装。ASYNC_CONTEXT_PATHEE, ASYNC_MAPPINGEE, ASYNC_PATH_INFOEE, ASYNC_QUERY_STRINGEE, ASYNC_REQUEST_URIEE, ASYNC_SERVLET_PATHEE
コンストラクターと説明 |
---|
MockAsyncContext(ServletRequestEE request, ServletResponseEE response) |
修飾子と型 | メソッドと説明 |
---|---|
void | addDispatchHandler(RunnableSE handler) |
void | addListener(AsyncListenerEE listener) |
void | addListener(AsyncListenerEE listener, ServletRequestEE request, ServletResponseEE response) |
void | complete() |
<T extends AsyncListenerEE> | createListener(ClassSE<T> clazz) |
void | dispatch() |
void | dispatch(ServletContextEE context, StringSE path) |
void | dispatch(StringSE path) |
StringSE | getDispatchedPath() |
ListSE<AsyncListenerEE> | getListeners() |
ServletRequestEE | getRequest() |
ServletResponseEE | getResponse() |
long | getTimeout() |
boolean | hasOriginalRequestAndResponse() |
void | setTimeout(long timeout) デフォルトでは、これは 10000 (10 秒に設定されています)。サーブレット API は、デフォルトの非同期リクエストタイムアウトを 30 秒に指定しています。 |
void | start(RunnableSE runnable) |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public MockAsyncContext(ServletRequestEE request, @Nullable ServletResponseEE response)
public void addDispatchHandler(RunnableSE handler)
public ServletRequestEE getRequest()
AsyncContextEE
の getRequestEE
@Nullable public ServletResponseEE getResponse()
AsyncContextEE
の getResponseEE
public boolean hasOriginalRequestAndResponse()
AsyncContextEE
の hasOriginalRequestAndResponseEE
public void dispatch()
AsyncContextEE
の dispatchEE
public void dispatch(StringSE path)
AsyncContextEE
の dispatchEE
public void dispatch(@Nullable ServletContextEE context, StringSE path)
AsyncContextEE
の dispatchEE
public void complete()
AsyncContextEE
の completeEE
public void start(RunnableSE runnable)
AsyncContextEE
の startEE
public void addListener(AsyncListenerEE listener)
AsyncContextEE
の addListenerEE
public void addListener(AsyncListenerEE listener, ServletRequestEE request, ServletResponseEE response)
AsyncContextEE
の addListenerEE
public ListSE<AsyncListenerEE> getListeners()
public <T extends AsyncListenerEE> T createListener(ClassSE<T> clazz) throws ServletExceptionEE
AsyncContextEE
の createListenerEE
ServletExceptionEE
public void setTimeout(long timeout)
DeferredResult
または SseEmitter
のリクエストごとにオーバーライドされることに注意してください。AsyncContextEE
の setTimeoutEE
timeout
- 使用するタイムアウト値。AsyncContext.setTimeout(long)
EEpublic long getTimeout()
AsyncContextEE
の getTimeoutEE