Class HttpChannelOverHttp

  • All Implemented Interfaces:
    java.lang.Runnable, org.eclipse.jetty.http.ComplianceViolation.Listener, org.eclipse.jetty.http.HttpParser.HttpHandler, org.eclipse.jetty.http.HttpParser.RequestHandler, HttpOutput.Interceptor

    public class HttpChannelOverHttp
    extends HttpChannel
    implements org.eclipse.jetty.http.HttpParser.RequestHandler, org.eclipse.jetty.http.ComplianceViolation.Listener
    An HttpChannel customized to be transported over the HTTP/1 protocol
    • Method Detail

      • startRequest

        public void startRequest​(java.lang.String method,
                                 java.lang.String uri,
                                 org.eclipse.jetty.http.HttpVersion version)
        Specified by:
        startRequest in interface org.eclipse.jetty.http.HttpParser.RequestHandler
      • parsedHeader

        public void parsedHeader​(org.eclipse.jetty.http.HttpField field)
        Specified by:
        parsedHeader in interface org.eclipse.jetty.http.HttpParser.HttpHandler
      • parsedTrailer

        public void parsedTrailer​(org.eclipse.jetty.http.HttpField field)
        Specified by:
        parsedTrailer in interface org.eclipse.jetty.http.HttpParser.HttpHandler
      • continue100

        public void continue100​(int available)
                         throws java.io.IOException
        If the associated response has the Expect header set to 100 Continue, then accessing the input stream indicates that the handler/servlet is ready for the request body and thus a 100 Continue response is sent.
        Overrides:
        continue100 in class HttpChannel
        Parameters:
        available - estimate of the number of bytes that are available
        Throws:
        java.io.IOException - if the InputStream cannot be created
      • earlyEOF

        public void earlyEOF()
        Specified by:
        earlyEOF in interface org.eclipse.jetty.http.HttpParser.HttpHandler
      • content

        public boolean content​(java.nio.ByteBuffer content)
        Specified by:
        content in interface org.eclipse.jetty.http.HttpParser.HttpHandler
      • badMessage

        public void badMessage​(org.eclipse.jetty.http.BadMessageException failure)
        Specified by:
        badMessage in interface org.eclipse.jetty.http.HttpParser.HttpHandler
      • headerComplete

        public boolean headerComplete()
        Specified by:
        headerComplete in interface org.eclipse.jetty.http.HttpParser.HttpHandler
      • handleException

        protected void handleException​(java.lang.Throwable x)
        Description copied from class: HttpChannel

        Sends an error 500, performing a special logic to detect whether the request is suspended, to avoid concurrent writes from the application.

        It may happen that the application suspends, and then throws an exception, while an application spawned thread writes the response content; in such case, we attempt to commit the error directly bypassing the ErrorHandler mechanisms and the response OutputStream.

        Overrides:
        handleException in class HttpChannel
        Parameters:
        x - the Throwable that caused the problem
      • abort

        public void abort​(java.lang.Throwable failure)
        Description copied from class: HttpChannel
        If a write or similar operation to this channel fails, then this method should be called.

        The standard implementation calls HttpTransport.abort(Throwable).

        Overrides:
        abort in class HttpChannel
        Parameters:
        failure - the failure that caused the abort.
      • contentComplete

        public boolean contentComplete()
        Specified by:
        contentComplete in interface org.eclipse.jetty.http.HttpParser.HttpHandler
      • messageComplete

        public boolean messageComplete()
        Specified by:
        messageComplete in interface org.eclipse.jetty.http.HttpParser.HttpHandler
      • onComplianceViolation

        public void onComplianceViolation​(org.eclipse.jetty.http.ComplianceViolation.Mode mode,
                                          org.eclipse.jetty.http.ComplianceViolation violation,
                                          java.lang.String details)
        Specified by:
        onComplianceViolation in interface org.eclipse.jetty.http.ComplianceViolation.Listener