- All Known Implementing Classes:
DefaultAsyncContext
public interface AsyncContext
The AsyncContext API.
- Author:
- Manfred Riem ([email protected])
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
Defines the ASYNC_CONTEXT_PATH constant.static String
Defines the ASYNC_MAPPING constant.static String
Defines the ASYNC_PATH_INFO constant.static String
Defines the ASYNC_QUERY_STRING constant.static String
Defines the ASYNC_REQUEST_URI constant.static String
Define the ASYNC_SERVLET_PATH constant. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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(ServletContext context, String path)
Dispatch the request.void
Dispatch the request.Returns the request.Returns the response.long
Returns the timeout.boolean
Has the original request and response.void
setTimeout(long timeout)
Set the timeout.void
Start the thread.
-
Field Details
-
ASYNC_CONTEXT_PATH
Defines the ASYNC_CONTEXT_PATH constant.- See Also:
- Constant Field Values
-
ASYNC_MAPPING
Defines the ASYNC_MAPPING constant.- See Also:
- Constant Field Values
-
ASYNC_PATH_INFO
Defines the ASYNC_PATH_INFO constant.- See Also:
- Constant Field Values
-
ASYNC_QUERY_STRING
Defines the ASYNC_QUERY_STRING constant.- See Also:
- Constant Field Values
-
ASYNC_REQUEST_URI
Defines the ASYNC_REQUEST_URI constant.- See Also:
- Constant Field Values
-
ASYNC_SERVLET_PATH
Define the ASYNC_SERVLET_PATH constant.- See Also:
- Constant Field Values
-
-
Method Details
-
addListener
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
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
Dispatch the request.- Parameters:
context
- the servlet context.path
- the path.
-
dispatch
Dispatch the request.- Parameters:
path
- the path.
-
getRequest
ServletRequest getRequest()Returns the request.- Returns:
- the request
-
getResponse
ServletResponse getResponse()Returns the response.- Returns:
- the response
-
getTimeout
long getTimeout()Returns 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
Start the thread.- Parameters:
runnable
- the runnable.
-