Package org.apache.coyote.http11
Class Http11Processor
java.lang.Object
org.apache.coyote.AbstractProcessorLight
org.apache.coyote.AbstractProcessor
org.apache.coyote.http11.Http11Processor
- All Implemented Interfaces:
- ActionHook,- Processor
- 
Field SummaryFields inherited from class org.apache.coyote.AbstractProcessoradapter, asyncStateMachine, request, response, socketWrapper, sslSupport, userDataHelper
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected final voidack(ContinueResponseTiming continueResponseTiming) protected final intavailable(boolean doRead) protected final voidprotected AbstractEndpoint.Handler.SocketStatePerform any necessary clean-up processing if the dispatch resulted in the completion of processing for the current request.protected final voiddoHttpUpgrade(UpgradeToken upgradeToken) Process an HTTP upgrade.protected final voidprotected final voidflush()protected booleanFlush any pending writes.Allows retrieving additional input during the upgrade process.protected LoggetLog()protected ServletConnectionProtocols must override this method and return an appropriate ServletConnection instanceGenerate an upgrade token.protected final booleanprotected final booleanprotected booleanprotected booleanProtocols that support trailer fields should override this method and returntrue.booleanProcessors that implement HTTP upgrade must override this method.voidpause()Informs the processor that the underlying I/O layer has stopped accepting new connections.protected voidCalled when a host header is not present or is empty in the request (e.g.protected final voidWhen committing the response, we have to validate the set of headers, as well as setup the response filters.final voidrecycle()Recycle the processor, ready for the next request which may be on the same connection or a different connection.protected final voidservice(SocketWrapperBase<?> socketWrapper) Service a 'standard' HTTP request.protected final voidsetRequestBody(ByteChunk body) protected final voidsetSocketWrapper(SocketWrapperBase<?> socketWrapper) Set the socket wrapper being used.protected final voidprotected final voidProcessors that can perform a TLS re-handshake (e.g.Methods inherited from class org.apache.coyote.AbstractProcessoraction, asyncPostProcess, checkAsyncTimeoutGeneration, dispatch, dispatchNonBlockingRead, doPush, execute, executeDispatches, getAdapter, getAsyncTimeout, getErrorState, getPopulateRequestAttributesFromSocket, getProtocolRequestId, getRequest, getSocketWrapper, isAsync, isPushSupported, isReadyForRead, logAccess, parseHost, populateHost, populateRequestAttributeRemoteHost, populateSslRequestAttributes, processSocketEvent, setAsyncTimeout, setErrorState, setSslSupport, timeoutAsyncMethods inherited from class org.apache.coyote.AbstractProcessorLightaddDispatch, clearDispatches, getIteratorAndClearDispatches, process
- 
Constructor Details- 
Http11Processor
 
- 
- 
Method Details- 
servicepublic AbstractEndpoint.Handler.SocketState service(SocketWrapperBase<?> socketWrapper) throws 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:
- socketWrapper- The connection to process
- Returns:
- The state the caller should put the socket in when this method returns
- Throws:
- IOException- If an I/O error occurs during the processing of the request
 
- 
setSocketWrapperDescription copied from class:AbstractProcessorSet the socket wrapper being used.- Overrides:
- setSocketWrapperin class- AbstractProcessor
- Parameters:
- socketWrapper- The socket wrapper
 
- 
prepareResponseWhen committing the response, we have to validate the set of headers, as well as setup the response filters.- Specified by:
- prepareResponsein class- AbstractProcessor
- Throws:
- IOException
 
- 
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 provides the server port from the local port. - Overrides:
- populatePortin class- AbstractProcessor
 
- 
flushBufferedWriteDescription 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:
- IOException- If an I/O error occurs while attempting to flush the data
 
- 
dispatchEndRequestDescription 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
 
- 
getLog- Specified by:
- getLogin class- AbstractProcessorLight
 
- 
getServletConnectionDescription copied from class:AbstractProcessorProtocols must override this method and return an appropriate ServletConnection instance- Specified by:
- getServletConnectionin class- AbstractProcessor
- Returns:
- the ServletConnection instance associated with the current request.
 
- 
finishResponse- Specified by:
- finishResponsein class- AbstractProcessor
- Throws:
- IOException
 
- 
ack- Specified by:
- ackin class- AbstractProcessor
 
- 
flush- Specified by:
- flushin class- AbstractProcessor
- Throws:
- IOException
 
- 
availableprotected final int available(boolean doRead) - Specified by:
- availablein class- AbstractProcessor
 
- 
setRequestBody- Specified by:
- setRequestBodyin class- AbstractProcessor
 
- 
setSwallowResponseprotected final void setSwallowResponse()- Specified by:
- setSwallowResponsein class- AbstractProcessor
 
- 
disableSwallowRequestprotected final void disableSwallowRequest()- Specified by:
- disableSwallowRequestin class- AbstractProcessor
 
- 
sslReHandShakeDescription copied from class:AbstractProcessorProcessors that can perform a TLS re-handshake (e.g. HTTP/1.1) should override this method and implement the re-handshake.- Overrides:
- sslReHandShakein class- AbstractProcessor
- Throws:
- IOException- If authentication is required then there will be I/O with the client and this exception will be thrown if that goes wrong
 
- 
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
 
- 
getUpgradeTokenDescription copied from class:AbstractProcessorGenerate an upgrade token. Processors that implement HTTP upgrade must override this method and provide the necessary token.- Specified by:
- getUpgradeTokenin interface- Processor
- Overrides:
- getUpgradeTokenin class- AbstractProcessor
- Returns:
- An upgrade token encapsulating the information required to process the upgrade request
 
- 
doHttpUpgradeDescription copied from class:AbstractProcessorProcess an HTTP upgrade. Processors that support HTTP upgrade should override this method and process the provided token.- Overrides:
- doHttpUpgradein class- AbstractProcessor
- Parameters:
- upgradeToken- Contains all the information necessary for the Processor to process the upgrade
 
- 
getLeftoverInputDescription copied from class:AbstractProcessorAllows retrieving additional input during the upgrade process. Processors that implement HTTP upgrade must override this method.- Specified by:
- getLeftoverInputin interface- Processor
- Overrides:
- getLeftoverInputin class- AbstractProcessor
- Returns:
- leftover bytes
 
- 
isUpgradepublic boolean isUpgrade()Description copied from class:AbstractProcessorProcessors that implement HTTP upgrade must override this method.- Specified by:
- isUpgradein interface- Processor
- Overrides:
- isUpgradein class- AbstractProcessor
- Returns:
- trueif the Processor is currently processing an upgrade request, otherwise- false
 
- 
isTrailerFieldsReadyprotected boolean isTrailerFieldsReady()- Specified by:
- isTrailerFieldsReadyin class- AbstractProcessor
 
- 
isTrailerFieldsSupportedprotected boolean isTrailerFieldsSupported()Description copied from class:AbstractProcessorProtocols that support trailer fields should override this method and returntrue.- Overrides:
- isTrailerFieldsSupportedin class- AbstractProcessor
- Returns:
- trueif trailer fields are supported by this processor, otherwise- false.
 
- 
recyclepublic final 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.
 
-