Package javax.servlet
Interface AsyncContext
-
- All Known Implementing Classes:
AsyncContextState
public interface AsyncContext
TODO SERVLET3 - Add comments- Since:
- Servlet 3.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ASYNC_CONTEXT_PATH
static java.lang.String
ASYNC_PATH_INFO
static java.lang.String
ASYNC_QUERY_STRING
static java.lang.String
ASYNC_REQUEST_URI
static java.lang.String
ASYNC_SERVLET_PATH
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(AsyncListener listener)
void
addListener(AsyncListener listener, ServletRequest request, ServletResponse response)
void
complete()
<T extends AsyncListener>
TcreateListener(java.lang.Class<T> clazz)
void
dispatch()
void
dispatch(java.lang.String path)
void
dispatch(ServletContext context, java.lang.String path)
ServletRequest
getRequest()
ServletResponse
getResponse()
long
getTimeout()
Get the current timeout.boolean
hasOriginalRequestAndResponse()
void
setTimeout(long timeout)
Set the timeout.void
start(java.lang.Runnable run)
-
-
-
Field Detail
-
ASYNC_REQUEST_URI
static final java.lang.String ASYNC_REQUEST_URI
- See Also:
- Constant Field Values
-
ASYNC_CONTEXT_PATH
static final java.lang.String ASYNC_CONTEXT_PATH
- See Also:
- Constant Field Values
-
ASYNC_PATH_INFO
static final java.lang.String ASYNC_PATH_INFO
- See Also:
- Constant Field Values
-
ASYNC_SERVLET_PATH
static final java.lang.String ASYNC_SERVLET_PATH
- See Also:
- Constant Field Values
-
ASYNC_QUERY_STRING
static final java.lang.String ASYNC_QUERY_STRING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRequest
ServletRequest getRequest()
-
getResponse
ServletResponse getResponse()
-
hasOriginalRequestAndResponse
boolean hasOriginalRequestAndResponse()
-
dispatch
void dispatch()
- Throws:
java.lang.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
void dispatch(java.lang.String path)
- Parameters:
path
- The path to which the request/response should be dispatched relative to theServletContext
from which this async request was started.- Throws:
java.lang.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
void dispatch(ServletContext context, java.lang.String path)
- Parameters:
path
- The path to which the request/response should be dispatched relative to the specifiedServletContext
.context
- TheServletContext
to which the request/response should be dispatched.- Throws:
java.lang.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
void start(java.lang.Runnable run)
-
addListener
void addListener(AsyncListener listener)
-
addListener
void addListener(AsyncListener listener, ServletRequest request, ServletResponse response)
-
createListener
<T extends AsyncListener> T createListener(java.lang.Class<T> clazz) throws ServletException
- 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.
-
-