Class AjpProcessor

    • Field Detail

      • ajpFlush

        protected boolean ajpFlush
        Send AJP flush packet when flushing. An flush packet is a zero byte AJP13 SEND_BODY_CHUNK packet. mod_jk and mod_proxy_ajp interprete this as a request to flush data to the client. AJP always does flush at the and of the response, so if it is not important, that the packets get streamed up to the client, do not use extra flush packets. For compatibility and to stay on the safe side, flush packets are enabled by default.
    • Constructor Detail

      • AjpProcessor

        public AjpProcessor​(int packetSize,
                            AbstractEndpoint<?,​?> endpoint)
    • Method Detail

      • getAjpFlush

        public boolean getAjpFlush()
      • setAjpFlush

        public void setAjpFlush​(boolean ajpFlush)
      • getKeepAliveTimeout

        public int getKeepAliveTimeout()
      • setKeepAliveTimeout

        public void setKeepAliveTimeout​(int timeout)
      • getTomcatAuthentication

        public boolean getTomcatAuthentication()
      • setTomcatAuthentication

        public void setTomcatAuthentication​(boolean tomcatAuthentication)
      • getTomcatAuthorization

        public boolean getTomcatAuthorization()
      • setTomcatAuthorization

        public void setTomcatAuthorization​(boolean tomcatAuthorization)
      • setRequiredSecret

        public void setRequiredSecret​(java.lang.String requiredSecret)
      • setSecret

        public void setSecret​(java.lang.String secret)
      • getClientCertProvider

        public java.lang.String getClientCertProvider()
      • setClientCertProvider

        public void setClientCertProvider​(java.lang.String clientCertProvider)
      • setAllowedRequestAttributesPattern

        public void setAllowedRequestAttributesPattern​(java.util.regex.Pattern allowedRequestAttributesPattern)
      • flushBufferedWrite

        protected boolean flushBufferedWrite()
        Description copied from class: AbstractProcessor
        Flush any pending writes. Used during non-blocking writes to flush any remaining data from a previous incomplete write.
        Specified by:
        flushBufferedWrite in class AbstractProcessor
        true if data remains to be flushed at the end of method
        Throws: - If an I/O error occurs while attempting to flush the data
      • service

        public AbstractEndpoint.Handler.SocketState service​(SocketWrapperBase<?> socket)
        Description copied from class: AbstractProcessorLight
        Service a 'standard' HTTP request. This method is called for both new requests and for requests that have partially read the HTTP request line or HTTP headers. Once the headers have been fully read this method is not called again until there is a new HTTP request to process. Note that the request type may change during processing which may result in one or more calls to AbstractProcessorLight.dispatch(SocketEvent). Requests may be pipe-lined.
        Specified by:
        service in class AbstractProcessorLight
        socket - The connection to process
        The state the caller should put the socket in when this method returns
        Throws: - If an I/O error occurs during the processing of the request
      • recycle

        public void recycle()
        Description copied from interface: Processor
        Recycle the processor, ready for the next request which may be on the same connection or a different connection.
        Specified by:
        recycle in interface Processor
        recycle in class AbstractProcessor
      • pause

        public void pause()
        Description copied from interface: Processor
        Informs the processor that the underlying I/O layer has stopped accepting new connections. This is primarily intended to enable processors that use multiplexed connections to prevent further 'streams' being added to an existing multiplexed connection.
      • refillReadBuffer

        protected boolean refillReadBuffer​(boolean block)
        Get more request body data from the web server and store it in the internal buffer.
        block - true if this is blocking IO
        true if there is more data, false if not.
        Throws: - An IO error occurred
      • populateHost

        protected void populateHost()
        Called when a host header is not present in the request (e.g. HTTP/1.0). It populates the server name with appropriate information. The source is expected to vary by protocol.

        The default implementation is a NO-OP.

        This implementation populates the server name from the local name provided by the AJP message.

        populateHost in class AbstractProcessor
      • populatePort

        protected void populatePort()
        Called when a host header is not present or is empty in the request (e.g. HTTP/1.0). It populates the server port with appropriate information. The source is expected to vary by protocol.

        The default implementation is a NO-OP.

        This implementation populates the server port from the local port provided by the AJP message.

        populatePort in class AbstractProcessor
      • prepareResponse

        protected final void prepareResponse()
        When committing the response, we have to validate the set of headers, as well as setup the response filters.
        Specified by:
        prepareResponse in class AbstractProcessor
      • flush

        protected final void flush()
        Callback to write data from the buffer.
        Specified by:
        flush in class AbstractProcessor
      • finishResponse

        protected final void finishResponse()
        Finish AJP response.
        Specified by:
        finishResponse in class AbstractProcessor
      • getPopulateRequestAttributesFromSocket

        protected final boolean getPopulateRequestAttributesFromSocket()
        Description copied from class: AbstractProcessor
        Processors that populate request attributes directly (e.g. AJP) should over-ride this method and return false.
        getPopulateRequestAttributesFromSocket in class AbstractProcessor
        true if the SocketWrapper should be used to populate the request attributes, otherwise false.
      • populateRequestAttributeRemoteHost

        protected final void populateRequestAttributeRemoteHost()
        Description copied from class: AbstractProcessor
        Populate the remote host request attribute. Processors (e.g. AJP) that populate this from an alternative source should override this method.
        populateRequestAttributeRemoteHost in class AbstractProcessor
      • populateSslRequestAttributes

        protected final void populateSslRequestAttributes()
        Description copied from class: AbstractProcessor
        Populate the TLS related request attributes from the SSLSupport instance associated with this processor. Protocols that populate TLS attributes from a different source (e.g. AJP) should override this method.
        populateSslRequestAttributes in class AbstractProcessor