public class AsyncContextImpl extends Object implements javax.servlet.AsyncContext
Constructor and Description |
---|
AsyncContextImpl(HttpServerExchange exchange, javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, ServletRequestContext servletRequestContext, boolean requestSupplied, AsyncContextImpl previousAsyncContext) |
Modifier and Type | Method and Description |
---|---|
void | addAsyncTask(Runnable runnable) Adds a task to be run to the async context. |
void | addListener(javax.servlet.AsyncListener listener) |
void | addListener(javax.servlet.AsyncListener listener, javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) |
void | complete() |
void | completeInternal(boolean forceComplete) |
<T extends javax.servlet.AsyncListener> | createListener(Class<T> clazz) |
void | dispatch() |
void | dispatch(javax.servlet.ServletContext context, String path) |
void | dispatch(String path) |
javax.servlet.ServletRequest | getRequest() |
javax.servlet.ServletResponse | getResponse() |
long | getTimeout() |
void | handleCompletedBeforeInitialRequestDone() |
void | handleError(Throwable error) |
boolean | hasOriginalRequestAndResponse() |
void | initialRequestDone() Called by the container when the initial request is finished. |
void | initialRequestFailed() |
boolean | isCompletedBeforeInitialRequestDone() |
boolean | isDispatched() |
void | setTimeout(long timeout) |
void | start(Runnable run) |
void | updateTimeout() |
public AsyncContextImpl(HttpServerExchange exchange, javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, ServletRequestContext servletRequestContext, boolean requestSupplied, AsyncContextImpl previousAsyncContext)
public void updateTimeout()
public javax.servlet.ServletRequest getRequest()
getRequest
in interface javax.servlet.AsyncContext
public javax.servlet.ServletResponse getResponse()
getResponse
in interface javax.servlet.AsyncContext
public boolean hasOriginalRequestAndResponse()
hasOriginalRequestAndResponse
in interface javax.servlet.AsyncContext
public void dispatch()
dispatch
in interface javax.servlet.AsyncContext
public void dispatch(String path)
dispatch
in interface javax.servlet.AsyncContext
public void dispatch(javax.servlet.ServletContext context, String path)
dispatch
in interface javax.servlet.AsyncContext
public void complete()
complete
in interface javax.servlet.AsyncContext
public void completeInternal(boolean forceComplete)
public void start(Runnable run)
start
in interface javax.servlet.AsyncContext
public void addListener(javax.servlet.AsyncListener listener)
addListener
in interface javax.servlet.AsyncContext
public void addListener(javax.servlet.AsyncListener listener, javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse)
addListener
in interface javax.servlet.AsyncContext
public boolean isDispatched()
public boolean isCompletedBeforeInitialRequestDone()
public <T extends javax.servlet.AsyncListener> T createListener(Class<T> clazz) throws javax.servlet.ServletException
createListener
in interface javax.servlet.AsyncContext
javax.servlet.ServletException
public void setTimeout(long timeout)
setTimeout
in interface javax.servlet.AsyncContext
public long getTimeout()
getTimeout
in interface javax.servlet.AsyncContext
public void handleError(Throwable error)
public void initialRequestDone()
public void initialRequestFailed()
public void handleCompletedBeforeInitialRequestDone()
public void addAsyncTask(Runnable runnable)
This method is intended to be used to queue read and write tasks for async streams, to make sure that multiple threads do not end up working on the same exchange at once
runnable
- The runnableCopyright © 2020 JBoss by Red Hat. All rights reserved.