Package org.apache.activemq.web.async
Class AsyncServletRequest
- java.lang.Object
-
- org.apache.activemq.web.async.AsyncServletRequest
-
- All Implemented Interfaces:
EventListener,javax.servlet.AsyncListener
public class AsyncServletRequest extends Object implements javax.servlet.AsyncListener
Wrapper object to hold and track Async servlet requests. This is a replacement for the deprecated/removed Jetty Continuation API as that has long been replaced by the Servlet Async api.
-
-
Constructor Summary
Constructors Constructor Description AsyncServletRequest(javax.servlet.ServletRequest request)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete()voiddispatch()javax.servlet.AsyncContextgetAsyncContext()static AsyncServletRequestgetAsyncRequest(javax.servlet.ServletRequest request)Look up the existing async request or create/ store a new request that be referenced laterbooleanisDispatched()booleanisExpired()booleanisInitial()voidonComplete(javax.servlet.AsyncEvent event)voidonError(javax.servlet.AsyncEvent event)voidonStartAsync(javax.servlet.AsyncEvent event)voidonTimeout(javax.servlet.AsyncEvent event)voidsetAttribute(String name, Object attribute)voidsetTimeoutMs(long timeoutMs)voidstartAsync()
-
-
-
Method Detail
-
complete
public void complete()
-
startAsync
public void startAsync()
-
dispatch
public void dispatch()
-
setTimeoutMs
public void setTimeoutMs(long timeoutMs)
-
isInitial
public boolean isInitial()
-
isExpired
public boolean isExpired()
-
isDispatched
public boolean isDispatched()
-
getAsyncContext
public javax.servlet.AsyncContext getAsyncContext()
-
onComplete
public void onComplete(javax.servlet.AsyncEvent event)
- Specified by:
onCompletein interfacejavax.servlet.AsyncListener
-
onTimeout
public void onTimeout(javax.servlet.AsyncEvent event)
- Specified by:
onTimeoutin interfacejavax.servlet.AsyncListener
-
onError
public void onError(javax.servlet.AsyncEvent event)
- Specified by:
onErrorin interfacejavax.servlet.AsyncListener
-
onStartAsync
public void onStartAsync(javax.servlet.AsyncEvent event)
- Specified by:
onStartAsyncin interfacejavax.servlet.AsyncListener
-
getAsyncRequest
public static AsyncServletRequest getAsyncRequest(javax.servlet.ServletRequest request)
Look up the existing async request or create/ store a new request that be referenced later- Parameters:
request- the ServletRequest- Returns:
- the existing or new ActiveMQAsyncRequest
-
-