Package org.apache.coyote.ajp
Class AjpProcessor
- java.lang.Object
- 
- org.apache.coyote.AbstractProcessorLight
- 
- org.apache.coyote.AbstractProcessor
- 
- org.apache.coyote.ajp.AjpProcessor
 
 
 
- 
- All Implemented Interfaces:
- ActionHook,- Processor
 
 public class AjpProcessor extends AbstractProcessor AJP Processor implementation.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classAjpProcessor.SocketInputBufferThis class is an input buffer which will read its data from an input stream.protected classAjpProcessor.SocketOutputBufferThis class is an output buffer which will write data to an output stream.
 - 
Field SummaryFields Modifier and Type Field Description protected booleanajpFlushSend AJP flush packet when flushing.- 
Fields inherited from class org.apache.coyote.AbstractProcessoradapter, asyncStateMachine, endpoint, hostNameC, request, response, socketWrapper, sslSupport, userDataHelper
 
- 
 - 
Constructor SummaryConstructors Constructor Description AjpProcessor(int packetSize, AbstractEndpoint<?,?> endpoint)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidack(ContinueResponseTiming continueResponseTiming)protected intavailable(boolean doRead)protected voiddisableSwallowRequest()protected AbstractEndpoint.Handler.SocketStatedispatchEndRequest()Perform any necessary clean-up processing if the dispatch resulted in the completion of processing for the current request.protected voiddispatchNonBlockingRead()Perform any necessary processing for a non-blocking read before dispatching to the adapter.protected voidfinishResponse()Finish AJP response.protected voidflush()Callback to write data from the buffer.protected booleanflushBufferedWrite()Flush any pending writes.booleangetAjpFlush()java.lang.StringgetClientCertProvider()intgetKeepAliveTimeout()protected LoggetLog()protected booleangetPopulateRequestAttributesFromSocket()Processors that populate request attributes directly (e.g.booleangetTomcatAuthentication()booleangetTomcatAuthorization()protected booleanisReadyForWrite()protected booleanisRequestBodyFullyRead()voidpause()Informs the processor that the underlying I/O layer has stopped accepting new connections.protected voidpopulateHost()Called when a host header is not present in the request (e.g.protected voidpopulatePort()Called when a host header is not present or is empty in the request (e.g.protected voidpopulateRequestAttributeRemoteHost()Populate the remote host request attribute.protected voidpopulateSslRequestAttributes()Populate the TLS related request attributes from theSSLSupportinstance associated with this processor.protected voidprepareResponse()When committing the response, we have to validate the set of headers, as well as setup the response filters.voidrecycle()Recycle the processor, ready for the next request which may be on the same connection or a different connection.protected booleanrefillReadBuffer(boolean block)Get more request body data from the web server and store it in the internal buffer.protected voidregisterReadInterest()AbstractEndpoint.Handler.SocketStateservice(SocketWrapperBase<?> socket)Service a 'standard' HTTP request.voidsetAjpFlush(boolean ajpFlush)voidsetAllowedRequestAttributesPattern(java.util.regex.Pattern allowedRequestAttributesPattern)voidsetClientCertProvider(java.lang.String clientCertProvider)voidsetKeepAliveTimeout(int timeout)protected voidsetRequestBody(ByteChunk body)voidsetRequiredSecret(java.lang.String requiredSecret)Deprecated.voidsetSecret(java.lang.String secret)protected voidsetSwallowResponse()voidsetTomcatAuthentication(boolean tomcatAuthentication)voidsetTomcatAuthorization(boolean tomcatAuthorization)- 
Methods inherited from class org.apache.coyote.AbstractProcessorack, action, asyncPostProcess, checkAsyncTimeoutGeneration, dispatch, doHttpUpgrade, doPush, executeDispatches, getAdapter, getAsyncTimeout, getConnectionID, getErrorState, getExecutor, getLeftoverInput, getRequest, getSocketWrapper, getStreamID, getUpgradeToken, isAsync, isPushSupported, isReadyForRead, isUpgrade, logAccess, parseHost, processSocketEvent, setAdapter, setAsyncTimeout, setErrorState, setSocketWrapper, setSslSupport, sslReHandShake, timeoutAsync
 - 
Methods inherited from class org.apache.coyote.AbstractProcessorLightaddDispatch, clearDispatches, getIteratorAndClearDispatches, process
 
- 
 
- 
- 
- 
Field Detail- 
ajpFlushprotected 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- 
AjpProcessorpublic AjpProcessor(int packetSize, AbstractEndpoint<?,?> endpoint)
 
- 
 - 
Method Detail- 
getAjpFlushpublic boolean getAjpFlush() 
 - 
setAjpFlushpublic void setAjpFlush(boolean ajpFlush) 
 - 
getKeepAliveTimeoutpublic int getKeepAliveTimeout() 
 - 
setKeepAliveTimeoutpublic void setKeepAliveTimeout(int timeout) 
 - 
getTomcatAuthenticationpublic boolean getTomcatAuthentication() 
 - 
setTomcatAuthenticationpublic void setTomcatAuthentication(boolean tomcatAuthentication) 
 - 
getTomcatAuthorizationpublic boolean getTomcatAuthorization() 
 - 
setTomcatAuthorizationpublic void setTomcatAuthorization(boolean tomcatAuthorization) 
 - 
setRequiredSecret@Deprecated public void setRequiredSecret(java.lang.String requiredSecret) Deprecated.
 - 
setSecretpublic void setSecret(java.lang.String secret) 
 - 
getClientCertProviderpublic java.lang.String getClientCertProvider() 
 - 
setClientCertProviderpublic void setClientCertProvider(java.lang.String clientCertProvider) 
 - 
setAllowedRequestAttributesPatternpublic void setAllowedRequestAttributesPattern(java.util.regex.Pattern allowedRequestAttributesPattern) 
 - 
flushBufferedWriteprotected boolean flushBufferedWrite() throws java.io.IOExceptionDescription copied from class:AbstractProcessorFlush any pending writes. Used during non-blocking writes to flush any remaining data from a previous incomplete write.- Specified by:
- flushBufferedWritein class- AbstractProcessor
- Returns:
- trueif data remains to be flushed at the end of method
- Throws:
- java.io.IOException- If an I/O error occurs while attempting to flush the data
 
 - 
dispatchNonBlockingReadprotected void dispatchNonBlockingRead() Description copied from class:AbstractProcessorPerform any necessary processing for a non-blocking read before dispatching to the adapter.- Overrides:
- dispatchNonBlockingReadin class- AbstractProcessor
 
 - 
dispatchEndRequestprotected AbstractEndpoint.Handler.SocketState dispatchEndRequest() Description copied from class:AbstractProcessorPerform any necessary clean-up processing if the dispatch resulted in the completion of processing for the current request.- Specified by:
- dispatchEndRequestin class- AbstractProcessor
- Returns:
- The state to return for the socket once the clean-up for the current request has completed
 
 - 
servicepublic AbstractEndpoint.Handler.SocketState service(SocketWrapperBase<?> socket) throws java.io.IOException Description copied from class:AbstractProcessorLightService 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 toAbstractProcessorLight.dispatch(SocketEvent). Requests may be pipe-lined.- Specified by:
- servicein class- AbstractProcessorLight
- Parameters:
- socket- The connection to process
- Returns:
- The state the caller should put the socket in when this method returns
- Throws:
- java.io.IOException- If an I/O error occurs during the processing of the request
 
 - 
recyclepublic void recycle() Description copied from interface:ProcessorRecycle the processor, ready for the next request which may be on the same connection or a different connection.- Specified by:
- recyclein interface- Processor
- Overrides:
- recyclein class- AbstractProcessor
 
 - 
pausepublic void pause() Description copied from interface:ProcessorInforms 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.
 - 
refillReadBufferprotected boolean refillReadBuffer(boolean block) throws java.io.IOExceptionGet more request body data from the web server and store it in the internal buffer.- Parameters:
- block-- trueif this is blocking IO
- Returns:
- trueif there is more data,- falseif not.
- Throws:
- java.io.IOException- An IO error occurred
 
 - 
populateHostprotected 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. - Overrides:
- populateHostin class- AbstractProcessor
 
 - 
populatePortprotected 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. - Overrides:
- populatePortin class- AbstractProcessor
 
 - 
prepareResponseprotected final void prepareResponse() throws java.io.IOExceptionWhen committing the response, we have to validate the set of headers, as well as setup the response filters.- Specified by:
- prepareResponsein class- AbstractProcessor
- Throws:
- java.io.IOException
 
 - 
flushprotected final void flush() throws java.io.IOExceptionCallback to write data from the buffer.- Specified by:
- flushin class- AbstractProcessor
- Throws:
- java.io.IOException
 
 - 
finishResponseprotected final void finishResponse() throws java.io.IOExceptionFinish AJP response.- Specified by:
- finishResponsein class- AbstractProcessor
- Throws:
- java.io.IOException
 
 - 
ackprotected final void ack(ContinueResponseTiming continueResponseTiming) - Specified by:
- ackin class- AbstractProcessor
 
 - 
availableprotected final int available(boolean doRead) - Specified by:
- availablein class- AbstractProcessor
 
 - 
setRequestBodyprotected final void setRequestBody(ByteChunk body) - Specified by:
- setRequestBodyin class- AbstractProcessor
 
 - 
setSwallowResponseprotected final void setSwallowResponse() - Specified by:
- setSwallowResponsein class- AbstractProcessor
 
 - 
disableSwallowRequestprotected final void disableSwallowRequest() - Specified by:
- disableSwallowRequestin class- AbstractProcessor
 
 - 
getPopulateRequestAttributesFromSocketprotected final boolean getPopulateRequestAttributesFromSocket() Description copied from class:AbstractProcessorProcessors that populate request attributes directly (e.g. AJP) should over-ride this method and returnfalse.- Overrides:
- getPopulateRequestAttributesFromSocketin class- AbstractProcessor
- Returns:
- trueif the SocketWrapper should be used to populate the request attributes, otherwise- false.
 
 - 
populateRequestAttributeRemoteHostprotected final void populateRequestAttributeRemoteHost() Description copied from class:AbstractProcessorPopulate the remote host request attribute. Processors (e.g. AJP) that populate this from an alternative source should override this method.- Overrides:
- populateRequestAttributeRemoteHostin class- AbstractProcessor
 
 - 
populateSslRequestAttributesprotected final void populateSslRequestAttributes() Description copied from class:AbstractProcessorPopulate the TLS related request attributes from theSSLSupportinstance associated with this processor. Protocols that populate TLS attributes from a different source (e.g. AJP) should override this method.- Overrides:
- populateSslRequestAttributesin class- AbstractProcessor
 
 - 
isRequestBodyFullyReadprotected final boolean isRequestBodyFullyRead() - Specified by:
- isRequestBodyFullyReadin class- AbstractProcessor
 
 - 
registerReadInterestprotected final void registerReadInterest() - Specified by:
- registerReadInterestin class- AbstractProcessor
 
 - 
isReadyForWriteprotected final boolean isReadyForWrite() - Specified by:
- isReadyForWritein class- AbstractProcessor
 
 - 
getLogprotected Log getLog() - Specified by:
- getLogin class- AbstractProcessorLight
 
 
- 
 
-