Package org.apache.catalina.core
Class AsyncContextImpl
- java.lang.Object
-
- org.apache.catalina.core.AsyncContextImpl
-
- All Implemented Interfaces:
AsyncContext,AsyncContextCallback
public class AsyncContextImpl extends java.lang.Object implements AsyncContext, AsyncContextCallback
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringManagersm-
Fields inherited from interface javax.servlet.AsyncContext
ASYNC_CONTEXT_PATH, ASYNC_MAPPING, ASYNC_PATH_INFO, ASYNC_QUERY_STRING, ASYNC_REQUEST_URI, ASYNC_SERVLET_PATH
-
-
Constructor Summary
Constructors Constructor Description AsyncContextImpl(Request request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(AsyncListener listener)voidaddListener(AsyncListener listener, ServletRequest servletRequest, ServletResponse servletResponse)voidcomplete()<T extends AsyncListener>
TcreateListener(java.lang.Class<T> clazz)voiddispatch()voiddispatch(java.lang.String path)voiddispatch(ServletContext servletContext, java.lang.String path)protected voiddoInternalDispatch()voidfireOnComplete()ServletRequestgetRequest()ServletResponsegetResponse()longgetTimeout()Get the current timeout.booleanhasOriginalRequestAndResponse()booleanisAvailable()Reports if the web application associated with this async request is available.booleanisStarted()voidrecycle()voidsetErrorState(java.lang.Throwable t, boolean fireOnError)voidsetStarted(Context context, ServletRequest request, ServletResponse response, boolean originalRequestResponse)voidsetTimeout(long timeout)Set the timeout.voidstart(java.lang.Runnable run)booleantimeout()
-
-
-
Field Detail
-
sm
protected static final StringManager sm
-
-
Constructor Detail
-
AsyncContextImpl
public AsyncContextImpl(Request request)
-
-
Method Detail
-
complete
public void complete()
- Specified by:
completein interfaceAsyncContext
-
fireOnComplete
public void fireOnComplete()
- Specified by:
fireOnCompletein interfaceAsyncContextCallback
-
timeout
public boolean timeout()
-
dispatch
public void dispatch()
- Specified by:
dispatchin interfaceAsyncContext
-
dispatch
public void dispatch(java.lang.String path)
- Specified by:
dispatchin interfaceAsyncContext- Parameters:
path- The path to which the request/response should be dispatched relative to theServletContextfrom which this async request was started.
-
dispatch
public void dispatch(ServletContext servletContext, java.lang.String path)
- Specified by:
dispatchin interfaceAsyncContext- Parameters:
servletContext- TheServletContextto which the request/response should be dispatched.path- The path to which the request/response should be dispatched relative to the specifiedServletContext.
-
getRequest
public ServletRequest getRequest()
- Specified by:
getRequestin interfaceAsyncContext
-
getResponse
public ServletResponse getResponse()
- Specified by:
getResponsein interfaceAsyncContext
-
start
public void start(java.lang.Runnable run)
- Specified by:
startin interfaceAsyncContext
-
addListener
public void addListener(AsyncListener listener)
- Specified by:
addListenerin interfaceAsyncContext
-
addListener
public void addListener(AsyncListener listener, ServletRequest servletRequest, ServletResponse servletResponse)
- Specified by:
addListenerin interfaceAsyncContext
-
createListener
public <T extends AsyncListener> T createListener(java.lang.Class<T> clazz) throws ServletException
- Specified by:
createListenerin interfaceAsyncContext- Throws:
ServletException
-
recycle
public void recycle()
-
isStarted
public boolean isStarted()
-
setStarted
public void setStarted(Context context, ServletRequest request, ServletResponse response, boolean originalRequestResponse)
-
hasOriginalRequestAndResponse
public boolean hasOriginalRequestAndResponse()
- Specified by:
hasOriginalRequestAndResponsein interfaceAsyncContext
-
doInternalDispatch
protected void doInternalDispatch() throws ServletException, java.io.IOException- Throws:
ServletExceptionjava.io.IOException
-
getTimeout
public long getTimeout()
Description copied from interface:javax.servlet.AsyncContextGet the current timeout.- Specified by:
getTimeoutin interfaceAsyncContext- Returns:
- The timeout in milliseconds. 0 or less indicates no timeout.
-
setTimeout
public void setTimeout(long timeout)
Description copied from interface:javax.servlet.AsyncContextSet the timeout.- Specified by:
setTimeoutin interfaceAsyncContext- Parameters:
timeout- The timeout in milliseconds. 0 or less indicates no timeout.
-
isAvailable
public boolean isAvailable()
Description copied from interface:AsyncContextCallbackReports if the web application associated with this async request is available.- Specified by:
isAvailablein interfaceAsyncContextCallback- Returns:
trueif the associated web application is available, otherwisefalse
-
setErrorState
public void setErrorState(java.lang.Throwable t, boolean fireOnError)
-
-