Package javax.servlet
Interface AsyncContext
-
- All Known Implementing Classes:
DefaultAsyncContext
public interface AsyncContext
The AsyncContext API.- Author:
- Manfred Riem ([email protected])
-
-
Field Summary
Fields Modifier and Type Field Description static String
ASYNC_CONTEXT_PATH
Defines the ASYNC_CONTEXT_PATH constant.static String
ASYNC_MAPPING
Defines the ASYNC_MAPPING constant.static String
ASYNC_PATH_INFO
Defines the ASYNC_PATH_INFO constant.static String
ASYNC_QUERY_STRING
Defines the ASYNC_QUERY_STRING constant.static String
ASYNC_REQUEST_URI
Defines the ASYNC_REQUEST_URI constant.static String
ASYNC_SERVLET_PATH
Define the ASYNC_SERVLET_PATH constant.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(AsyncListener listener)
Add the async listener.void
addListener(AsyncListener listener, ServletRequest servletRequest, ServletResponse servletResponse)
Add the async listener.void
complete()
Complete the request.<T extends AsyncListener>
TcreateListener(Class<T> clazz)
Create the listener.void
dispatch()
Dispatch the request.void
dispatch(String path)
Dispatch the request.void
dispatch(ServletContext context, String path)
Dispatch the request.ServletRequest
getRequest()
Get the request.ServletResponse
getResponse()
Get the response.long
getTimeout()
Get the timeout.boolean
hasOriginalRequestAndResponse()
Has the original request and response.void
setTimeout(long timeout)
Set the timeout.void
start(Runnable runnable)
Start the thread.
-
-
-
Field Detail
-
ASYNC_CONTEXT_PATH
static final String ASYNC_CONTEXT_PATH
Defines the ASYNC_CONTEXT_PATH constant.- See Also:
- Constant Field Values
-
ASYNC_MAPPING
static final String ASYNC_MAPPING
Defines the ASYNC_MAPPING constant.- See Also:
- Constant Field Values
-
ASYNC_PATH_INFO
static final String ASYNC_PATH_INFO
Defines the ASYNC_PATH_INFO constant.- See Also:
- Constant Field Values
-
ASYNC_QUERY_STRING
static final String ASYNC_QUERY_STRING
Defines the ASYNC_QUERY_STRING constant.- See Also:
- Constant Field Values
-
ASYNC_REQUEST_URI
static final String ASYNC_REQUEST_URI
Defines the ASYNC_REQUEST_URI constant.- See Also:
- Constant Field Values
-
ASYNC_SERVLET_PATH
static final String ASYNC_SERVLET_PATH
Define the ASYNC_SERVLET_PATH constant.- See Also:
- Constant Field Values
-
-
Method Detail
-
addListener
void addListener(AsyncListener listener)
Add the async listener.- Parameters:
listener
- the async listener.
-
addListener
void addListener(AsyncListener listener, ServletRequest servletRequest, ServletResponse servletResponse)
Add the async listener.- Parameters:
listener
- the async listener.servletRequest
- the servlet request.servletResponse
- the servlet response.
-
complete
void complete()
Complete the request.
-
createListener
<T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException
Create the listener.- Type Parameters:
T
- the listener type.- Parameters:
clazz
- the class.- Returns:
- the listener.
- Throws:
ServletException
- when a serv
-
dispatch
void dispatch()
Dispatch the request.
-
dispatch
void dispatch(ServletContext context, String path)
Dispatch the request.- Parameters:
context
- the servlet context.path
- the path.
-
dispatch
void dispatch(String path)
Dispatch the request.- Parameters:
path
- the path.
-
getRequest
ServletRequest getRequest()
Get the request.- Returns:
- the request.
-
getResponse
ServletResponse getResponse()
Get the response.- Returns:
- the response.
-
getTimeout
long getTimeout()
Get the timeout.- Returns:
- the timeout.
-
hasOriginalRequestAndResponse
boolean hasOriginalRequestAndResponse()
Has the original request and response.- Returns:
- true if it does, false otherwise.
-
setTimeout
void setTimeout(long timeout)
Set the timeout.- Parameters:
timeout
- the timeout.
-
start
void start(Runnable runnable)
Start the thread.- Parameters:
runnable
- the runnable.
-
-