public class AsyncServletServerHttpRequest extends ServletServerHttpRequest implements AsyncServerHttpRequest, AsyncListener
FORM_CHARSET, FORM_CONTENT_TYPE| Constructor and Description |
|---|
AsyncServletServerHttpRequest(HttpServletRequest request,
HttpServletResponse response)
Create a new instance for the given request/response pair.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCompletionHandler(Runnable runnable) |
void |
addTimeoutHandler(Runnable timeoutHandler) |
void |
completeAsync() |
boolean |
isAsyncCompleted()
Whether async request processing has completed.
|
boolean |
isAsyncStarted() |
void |
onComplete(AsyncEvent event) |
void |
onError(AsyncEvent event) |
void |
onStartAsync(AsyncEvent event) |
void |
onTimeout(AsyncEvent event) |
void |
setTimeout(long timeout)
Timeout period begins after the container thread has exited.
|
void |
startAsync() |
getBody, getCookies, getHeaders, getMethod, getPrincipal, getQueryParams, getRemoteAddress, getRemoteHostName, getServletRequest, getURIclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPrincipal, getQueryParams, getRemoteAddress, getRemoteHostNamegetMethod, getURIgetBodygetCookies, getHeaderspublic AsyncServletServerHttpRequest(HttpServletRequest request, HttpServletResponse response)
public void setTimeout(long timeout)
setTimeout in interface AsyncServerHttpRequestpublic void addTimeoutHandler(Runnable timeoutHandler)
public void addCompletionHandler(Runnable runnable)
public boolean isAsyncStarted()
isAsyncStarted in interface AsyncServerHttpRequestpublic boolean isAsyncCompleted()
It is important to avoid use of request and response objects after async processing has completed. Servlet containers often re-use them.
isAsyncCompleted in interface AsyncServerHttpRequestpublic void startAsync()
startAsync in interface AsyncServerHttpRequestpublic void completeAsync()
completeAsync in interface AsyncServerHttpRequestpublic void onStartAsync(AsyncEvent event) throws IOException
onStartAsync in interface AsyncListenerIOExceptionpublic void onError(AsyncEvent event) throws IOException
onError in interface AsyncListenerIOExceptionpublic void onTimeout(AsyncEvent event) throws IOException
onTimeout in interface AsyncListenerIOExceptionpublic void onComplete(AsyncEvent event) throws IOException
onComplete in interface AsyncListenerIOException