Package org.apache.activemq.web.async
Class AsyncServletRequest
- java.lang.Object
-
- org.apache.activemq.web.async.AsyncServletRequest
-
- All Implemented Interfaces:
EventListener,AsyncListener
public class AsyncServletRequest extends Object implements 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(ServletRequest request)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete()voiddispatch()AsyncContextgetAsyncContext()static AsyncServletRequestgetAsyncRequest(ServletRequest request)Look up the existing async request or create/ store a new request that be referenced laterbooleanisDispatched()booleanisExpired()booleanisInitial()voidonComplete(AsyncEvent event)voidonError(AsyncEvent event)voidonStartAsync(AsyncEvent event)voidonTimeout(AsyncEvent event)voidsetAttribute(String name, Object attribute)voidsetTimeoutMs(long timeoutMs)voidstartAsync()
-
-
-
Constructor Detail
-
AsyncServletRequest
public AsyncServletRequest(ServletRequest request)
-
-
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 AsyncContext getAsyncContext()
-
onComplete
public void onComplete(AsyncEvent event)
- Specified by:
onCompletein interfaceAsyncListener
-
onTimeout
public void onTimeout(AsyncEvent event)
- Specified by:
onTimeoutin interfaceAsyncListener
-
onError
public void onError(AsyncEvent event)
- Specified by:
onErrorin interfaceAsyncListener
-
onStartAsync
public void onStartAsync(AsyncEvent event)
- Specified by:
onStartAsyncin interfaceAsyncListener
-
getAsyncRequest
public static AsyncServletRequest getAsyncRequest(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
-
-