Class AsyncServletRequest

java.lang.Object
org.apache.activemq.web.async.AsyncServletRequest
All Implemented Interfaces:
jakarta.servlet.AsyncListener, EventListener

public class AsyncServletRequest extends Object implements jakarta.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 Details

    • AsyncServletRequest

      public AsyncServletRequest(jakarta.servlet.ServletRequest request)
  • Method Details

    • complete

      public void complete()
    • startAsync

      public void startAsync()
    • dispatch

      public void dispatch()
    • setAttribute

      public void setAttribute(String name, Object attribute)
    • setTimeoutMs

      public void setTimeoutMs(long timeoutMs)
    • isInitial

      public boolean isInitial()
    • isExpired

      public boolean isExpired()
    • isDispatched

      public boolean isDispatched()
    • getAsyncContext

      public jakarta.servlet.AsyncContext getAsyncContext()
    • onComplete

      public void onComplete(jakarta.servlet.AsyncEvent event)
      Specified by:
      onComplete in interface jakarta.servlet.AsyncListener
    • onTimeout

      public void onTimeout(jakarta.servlet.AsyncEvent event)
      Specified by:
      onTimeout in interface jakarta.servlet.AsyncListener
    • onError

      public void onError(jakarta.servlet.AsyncEvent event)
      Specified by:
      onError in interface jakarta.servlet.AsyncListener
    • onStartAsync

      public void onStartAsync(jakarta.servlet.AsyncEvent event)
      Specified by:
      onStartAsync in interface jakarta.servlet.AsyncListener
    • getAsyncRequest

      public static AsyncServletRequest getAsyncRequest(jakarta.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