Class AsyncContextImpl

    • Constructor Detail

      • AsyncContextImpl

        public AsyncContextImpl​(Request request)
    • Method Detail

      • timeout

        public boolean timeout()
      • dispatch

        public void dispatch​(java.lang.String path)
        Specified by:
        dispatch in interface AsyncContext
        Parameters:
        path - The path to which the request/response should be dispatched relative to the ServletContext from which this async request was started.
      • dispatch

        public void dispatch​(ServletContext servletContext,
                             java.lang.String path)
        Specified by:
        dispatch in interface AsyncContext
        Parameters:
        servletContext - The ServletContext to which the request/response should be dispatched.
        path - The path to which the request/response should be dispatched relative to the specified ServletContext.
      • start

        public void start​(java.lang.Runnable run)
        Description copied from interface: jakarta.servlet.AsyncContext
        Starts a new thread to process the asynchronous request
        Specified by:
        start in interface AsyncContext
        Parameters:
        run - a Runnable that the new thread will run
      • addListener

        public void addListener​(AsyncListener listener)
        Description copied from interface: jakarta.servlet.AsyncContext
        Adds an event listener that will be called for different AsyncEvents fire
        Specified by:
        addListener in interface AsyncContext
        Parameters:
        listener - an AsyncListener that will be called with AsyncEvent objects
      • addListener

        public void addListener​(AsyncListener listener,
                                ServletRequest servletRequest,
                                ServletResponse servletResponse)
        Description copied from interface: jakarta.servlet.AsyncContext
        Adds an event listener that will be called when different AsyncEvents fire
        Specified by:
        addListener in interface AsyncContext
        Parameters:
        listener - an AsyncListener that will be called with AsyncEvent objects
        servletRequest - the ServletRequest that will be passed with the AsyncEvent
        servletResponse - the ServletResponse that will be passed with the AsyncEvent
      • createListener

        public <T extends AsyncListener> T createListener​(java.lang.Class<T> clazz)
                                                   throws ServletException
        Description copied from interface: jakarta.servlet.AsyncContext
        Creates and returns an AsyncListener object
        Specified by:
        createListener in interface AsyncContext
        Type Parameters:
        T - The type to create that extends AsyncListener
        Parameters:
        clazz - The class to instantiate to create the listener
        Returns:
        the newly created AsyncListener object
        Throws:
        ServletException - if the listener cannot be created
      • recycle

        public void recycle()
      • isStarted

        public boolean isStarted()
      • hasOriginalRequestAndResponse

        public boolean hasOriginalRequestAndResponse()
        Specified by:
        hasOriginalRequestAndResponse in interface AsyncContext
        Returns:
        true if the Request and Response are the original ones
      • getTimeout

        public long getTimeout()
        Description copied from interface: jakarta.servlet.AsyncContext
        Get the current timeout.
        Specified by:
        getTimeout in interface AsyncContext
        Returns:
        The timeout in milliseconds. 0 or less indicates no timeout.
      • setTimeout

        public void setTimeout​(long timeout)
        Description copied from interface: jakarta.servlet.AsyncContext
        Set the timeout.
        Specified by:
        setTimeout in interface AsyncContext
        Parameters:
        timeout - The timeout in milliseconds. 0 or less indicates no timeout.
      • isAvailable

        public boolean isAvailable()
        Description copied from interface: AsyncContextCallback
        Reports if the web application associated with this async request is available.
        Specified by:
        isAvailable in interface AsyncContextCallback
        Returns:
        true if the associated web application is available, otherwise false
      • setErrorState

        public void setErrorState​(java.lang.Throwable t,
                                  boolean fireOnError)
      • incrementInProgressAsyncCount

        public void incrementInProgressAsyncCount()
        Description copied from interface: AsyncContextCallback
        Used to notify the Context that async processing has started. Specifically, for the counting of in-progress async requests to work correctly, this must be called exactly once every time the AsyncStateMachine transitions from DISPATCHED to any other state.
        Specified by:
        incrementInProgressAsyncCount in interface AsyncContextCallback
      • decrementInProgressAsyncCount

        public void decrementInProgressAsyncCount()
        Description copied from interface: AsyncContextCallback
        Used to notify the Context that async processing has ended. Specifically, for the counting of in-progress async requests to work correctly, this must be called exactly once every time the AsyncStateMachine transitions to DISPATCHED from any other state.
        Specified by:
        decrementInProgressAsyncCount in interface AsyncContextCallback