Package javax.servlet
Interface AsyncContext
- All Known Implementing Classes:
AsyncContextState
public interface AsyncContext
TODO SERVLET3 - Add comments
- Since:
- Servlet 3.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(AsyncListener listener) voidaddListener(AsyncListener listener, ServletRequest request, ServletResponse response) voidcomplete()<T extends AsyncListener>
TcreateListener(Class<T> clazz) voiddispatch()voidvoiddispatch(ServletContext context, String path) longGet the current timeout.booleanvoidsetTimeout(long timeout) Set the timeout.void
-
Field Details
-
ASYNC_REQUEST_URI
- See Also:
-
ASYNC_CONTEXT_PATH
- See Also:
-
ASYNC_PATH_INFO
- See Also:
-
ASYNC_SERVLET_PATH
- See Also:
-
ASYNC_QUERY_STRING
- See Also:
-
-
Method Details
-
getRequest
ServletRequest getRequest() -
getResponse
ServletResponse getResponse() -
hasOriginalRequestAndResponse
boolean hasOriginalRequestAndResponse() -
dispatch
void dispatch()- Throws:
IllegalStateException- if this method is called when the request is not in asynchronous mode. The request is in asynchronous mode afterServletRequest.startAsync()orServletRequest.startAsync(ServletRequest, ServletResponse)has been called and beforecomplete()or any other dispatch() method has been called.
-
dispatch
- Parameters:
path- The path to which the request/response should be dispatched relative to theServletContextfrom which this async request was started.- Throws:
IllegalStateException- if this method is called when the request is not in asynchronous mode. The request is in asynchronous mode afterServletRequest.startAsync()orServletRequest.startAsync(ServletRequest, ServletResponse)has been called and beforecomplete()or any other dispatch() method has been called.
-
dispatch
- Parameters:
context- TheServletContextto which the request/response should be dispatched.path- The path to which the request/response should be dispatched relative to the specifiedServletContext.- Throws:
IllegalStateException- if this method is called when the request is not in asynchronous mode. The request is in asynchronous mode afterServletRequest.startAsync()orServletRequest.startAsync(ServletRequest, ServletResponse)has been called and beforecomplete()or any other dispatch() method has been called.
-
complete
void complete() -
start
-
addListener
-
addListener
-
createListener
- Throws:
ServletException
-
setTimeout
void setTimeout(long timeout) Set the timeout.- Parameters:
timeout- The timeout in milliseconds. 0 or less indicates no timeout.
-
getTimeout
long getTimeout()Get the current timeout.- Returns:
- The timeout in milliseconds. 0 or less indicates no timeout.
-