Class DelegatingAsyncContext

java.lang.Object
io.grpc.servlet.jakarta.web.DelegatingAsyncContext
All Implemented Interfaces:
jakarta.servlet.AsyncContext

public class DelegatingAsyncContext extends Object implements jakarta.servlet.AsyncContext
Util class to allow the complete() call to get some work done (writing trailers as a payload) before calling the actual container implementation. The container will finish closing the stream before invoking the async listener and formally informing the filter that the stream has closed, making this our last chance to intercept the closing of the stream before it happens.
  • Constructor Details

    • DelegatingAsyncContext

      public DelegatingAsyncContext(jakarta.servlet.AsyncContext delegate)
  • Method Details

    • getRequest

      public jakarta.servlet.ServletRequest getRequest()
      Specified by:
      getRequest in interface jakarta.servlet.AsyncContext
    • getResponse

      public jakarta.servlet.ServletResponse getResponse()
      Specified by:
      getResponse in interface jakarta.servlet.AsyncContext
    • hasOriginalRequestAndResponse

      public boolean hasOriginalRequestAndResponse()
      Specified by:
      hasOriginalRequestAndResponse in interface jakarta.servlet.AsyncContext
    • dispatch

      public void dispatch()
      Specified by:
      dispatch in interface jakarta.servlet.AsyncContext
    • dispatch

      public void dispatch(String path)
      Specified by:
      dispatch in interface jakarta.servlet.AsyncContext
    • dispatch

      public void dispatch(jakarta.servlet.ServletContext context, String path)
      Specified by:
      dispatch in interface jakarta.servlet.AsyncContext
    • complete

      public void complete()
      Specified by:
      complete in interface jakarta.servlet.AsyncContext
    • start

      public void start(Runnable run)
      Specified by:
      start in interface jakarta.servlet.AsyncContext
    • addListener

      public void addListener(jakarta.servlet.AsyncListener listener)
      Specified by:
      addListener in interface jakarta.servlet.AsyncContext
    • addListener

      public void addListener(jakarta.servlet.AsyncListener listener, jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse)
      Specified by:
      addListener in interface jakarta.servlet.AsyncContext
    • createListener

      public <T extends jakarta.servlet.AsyncListener> T createListener(Class<T> clazz) throws jakarta.servlet.ServletException
      Specified by:
      createListener in interface jakarta.servlet.AsyncContext
      Throws:
      jakarta.servlet.ServletException
    • setTimeout

      public void setTimeout(long timeout)
      Specified by:
      setTimeout in interface jakarta.servlet.AsyncContext
    • getTimeout

      public long getTimeout()
      Specified by:
      getTimeout in interface jakarta.servlet.AsyncContext