Class AsyncRequestHandlerResponse

    • Constructor Summary

      Constructors 
      Constructor Description
      AsyncRequestHandlerResponse​(java.util.concurrent.Executor executor)
      Creates an instance with a given Executor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.Executor getExecutor()
      Returns the Executor to be used to process the request.
      javax.servlet.AsyncListener getListener()
      Returns the listener to be added to the asynchronous request or null.
      javax.servlet.http.HttpServletRequest getRequest()
      Returns the request to be used with ServletRequest.startAsync() or null.
      javax.servlet.http.HttpServletResponse getResponse()
      Returns the response to be used with ServletRequest.startAsync() or null.
      long getTimeout()
      Returns the timeout, in milliseconds, for the asynchronous request.
      boolean isAsync()
      Returns whether the request should be processed asynchronously or not.
      boolean isHasRequestAndResponse()
      Returns whether a request and a response were set in this object.
      static AsyncRequestHandlerResponse notHandled()
      Returns a response saying this AsyncRequestHandler doesn't handle this request.
      java.lang.String toString()  
      AsyncRequestHandlerResponse with​(javax.servlet.AsyncListener listener)
      Defines a listener to be added to the asynchronous request.
      AsyncRequestHandlerResponse with​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Defines a different request and response to be passed to ServletRequest.startAsync(javax.servlet.ServletRequest, javax.servlet.ServletResponse).
      AsyncRequestHandlerResponse withTimeout​(long timeout)
      Sets the timeout for this asynchronous request in milliseconds.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AsyncRequestHandlerResponse

        public AsyncRequestHandlerResponse​(java.util.concurrent.Executor executor)
        Creates an instance with a given Executor. It cannot be null. If you want an instance with a non-async response, use notHandled() instead.
        Parameters:
        executor - a non-null Executor.
    • Method Detail

      • with

        public AsyncRequestHandlerResponse with​(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response)
        Defines a different request and response to be passed to ServletRequest.startAsync(javax.servlet.ServletRequest, javax.servlet.ServletResponse). Both cannot be null.
      • with

        public AsyncRequestHandlerResponse with​(javax.servlet.AsyncListener listener)
        Defines a listener to be added to the asynchronous request. It cannot be null.
      • isAsync

        public boolean isAsync()
        Returns whether the request should be processed asynchronously or not.
      • getExecutor

        public java.util.concurrent.Executor getExecutor()
        Returns the Executor to be used to process the request.
      • getRequest

        public javax.servlet.http.HttpServletRequest getRequest()
        Returns the request to be used with ServletRequest.startAsync() or null.
      • getResponse

        public javax.servlet.http.HttpServletResponse getResponse()
        Returns the response to be used with ServletRequest.startAsync() or null.
      • getListener

        public javax.servlet.AsyncListener getListener()
        Returns the listener to be added to the asynchronous request or null.
      • isHasRequestAndResponse

        public boolean isHasRequestAndResponse()
        Returns whether a request and a response were set in this object.
      • getTimeout

        public long getTimeout()
        Returns the timeout, in milliseconds, for the asynchronous request. Any value less than or equal zero is considered not having set a timeout.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object