Top Fields Constructors Methods
org.apache.coyote.http2

pack-priv Class StreamProcessor

extends AbstractProcessor
Class Inheritance
Imports
java.io.File, .IOException, java.util.Enumeration, .HashSet, .Iterator, .Set, java.util.concurrent.locks.Lock, .ReentrantLock, jakarta.servlet.ServletConnection, jakarta.servlet.http.HttpServletResponse, org.apache.coyote.AbstractProcessor, .ActionCode, .Adapter, .ContinueResponseTiming, .ErrorState, .Request, .RequestGroupInfo, .Response, org.apache.coyote.http11.filters.GzipOutputFilter, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.buf.ByteChunk, org.apache.tomcat.util.http.FastHttpDateFormat, .MimeHeaders, org.apache.tomcat.util.http.parser.HttpParser, org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState, .DispatchType, .SendfileState, .SocketEvent, .SocketWrapperBase, org.apache.tomcat.util.res.StringManager

Field Summary

Modifier and TypeField and Description
private static final Set<String>
private final Http2UpgradeHandler
private static final Log
private final Lock
private SendfileData
private SendfileState
private static final StringManager
private final Stream
Inherited from org.apache.coyote.AbstractProcessor:
adapterasyncStateMachinerequestresponsesocketWrappersslSupportuserDataHelper

Constructor Summary

AccessConstructor and Description
pack-priv
StreamProcessor(Http2UpgradeHandler handler, Stream stream, Adapter adapter, SocketWrapperBase<?> socketWrapper)

Method Summary

Modifier and TypeMethod and Description
protected final void
ack(ContinueResponseTiming continueResponseTiming)

Implements abstract org.apache.coyote.AbstractProcessor.ack.

protected final int
available(boolean doRead)

Implements abstract org.apache.coyote.AbstractProcessor.available.

protected final void
protected final AbstractEndpoint.Handler.SocketState
dispatchEndRequest()

Implements abstract org.apache.coyote.AbstractProcessor.dispatchEndRequest.

Perform any necessary clean-up processing if the dispatch resulted in the completion of processing for the current request.

protected final void
doPush(Request
Contains all the information necessary for the Processor to process the push request
pushTarget
)

Overrides org.apache.coyote.AbstractProcessor.doPush.

Process a push.

protected final void
protected final void
protected final void
protected final boolean
flushBufferedWrite()

Implements abstract org.apache.coyote.AbstractProcessor.flushBufferedWrite.

Flush any pending writes.

protected final Log
protected String
getProtocolRequestId()

Overrides org.apache.coyote.AbstractProcessor.getProtocolRequestId.

Protocols that provide per HTTP request IDs (e.g. Stream ID for HTTP/2) should override this method and return the appropriate ID.

protected ServletConnection
getServletConnection()

Implements abstract org.apache.coyote.AbstractProcessor.getServletConnection.

Protocols must override this method and return an appropriate ServletConnection instance

protected final boolean
isPushSupported()

Overrides org.apache.coyote.AbstractProcessor.isPushSupported.

Protocols that support push should override this method and return true.

protected final boolean
protected final boolean
protected final boolean
protected boolean
protected boolean
isTrailerFieldsSupported()

Overrides org.apache.coyote.AbstractProcessor.isTrailerFieldsSupported.

Protocols that support trailer fields should override this method and return true.

public final void
pause()

Implements org.apache.coyote.Processor.pause.

Informs the processor that the underlying I/O layer has stopped accepting new connections.

pack-priv static void
prepareHeaders(Request coyoteRequest, Response coyoteResponse, boolean noSendfile, Http2Protocol protocol, Stream stream)

protected final void
private void
pack-priv final void
protected void
public final void
recycle()

Overrides org.apache.coyote.AbstractProcessor.recycle.

Implements org.apache.coyote.Processor.recycle.

Recycle the processor, ready for the next request which may be on the same connection or a different connection.

protected final void
public final AbstractEndpoint.Handler.SocketState
service(SocketWrapperBase<?>
The connection to process
socket
)

Implements abstract org.apache.coyote.AbstractProcessorLight.service.

Service a 'standard' HTTP request.

protected final void
protected final void
private boolean
Inherited from org.apache.coyote.AbstractProcessor:
actionasyncPostProcesscheckAsyncTimeoutGenerationdispatchdispatchNonBlockingReaddoHttpUpgradeexecutegetAdaptergetAsyncTimeoutgetErrorStategetLeftoverInputgetPopulateRequestAttributesFromSocketgetRequestgetSocketWrappergetUpgradeTokenisAsyncisUpgradelogAccessparseHostpopulateHostpopulatePortpopulateRequestAttributeRemoteHostpopulateSslRequestAttributessetAsyncTimeoutsetErrorStatesetSocketWrappersetSslSupportsslReHandShaketimeoutAsync

Field Detail

H2_PSEUDO_HEADERS_REQUESTback to summary
private static final Set<String> H2_PSEUDO_HEADERS_REQUEST
handlerback to summary
private final Http2UpgradeHandler handler
logback to summary
private static final Log log
processLockback to summary
private final Lock processLock
sendfileDataback to summary
private SendfileData sendfileData
sendfileStateback to summary
private SendfileState sendfileState
smback to summary
private static final StringManager sm

Hides org.apache.coyote.AbstractProcessor.sm.

streamback to summary
private final Stream stream

Constructor Detail

StreamProcessorback to summary
pack-priv StreamProcessor(Http2UpgradeHandler handler, Stream stream, Adapter adapter, SocketWrapperBase<?> socketWrapper)

Method Detail

ackback to summary
protected final void ack(ContinueResponseTiming continueResponseTiming)

Implements abstract org.apache.coyote.AbstractProcessor.ack.

Annotations
@Override
availableback to summary
protected final int available(boolean doRead)

Implements abstract org.apache.coyote.AbstractProcessor.available.

Annotations
@Override
disableSwallowRequestback to summary
protected final void disableSwallowRequest()

Implements abstract org.apache.coyote.AbstractProcessor.disableSwallowRequest.

Annotations
@Override
dispatchEndRequestback to summary
protected final AbstractEndpoint.Handler.SocketState dispatchEndRequest() throws IOException

Implements abstract org.apache.coyote.AbstractProcessor.dispatchEndRequest.

Doc from org.apache.coyote.AbstractProcessor.dispatchEndRequest.

Perform any necessary clean-up processing if the dispatch resulted in the completion of processing for the current request.

Returns:AbstractEndpoint.Handler.SocketState

The state to return for the socket once the clean-up for the current request has completed

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs while attempting to end the request
doPushback to summary
protected final void doPush(Request pushTarget)

Overrides org.apache.coyote.AbstractProcessor.doPush.

Doc from org.apache.coyote.AbstractProcessor.doPush.

Process a push. Processors that support push should override this method and process the provided token.

Parameters
pushTarget:Request

Contains all the information necessary for the Processor to process the push request

Annotations
@Override
executeDispatchesback to summary
protected final void executeDispatches()

Overrides org.apache.coyote.AbstractProcessor.executeDispatches.

Annotations
@Override
finishResponseback to summary
protected final void finishResponse() throws IOException

Implements abstract org.apache.coyote.AbstractProcessor.finishResponse.

Annotations
@Override
flushback to summary
protected final void flush() throws IOException

Implements abstract org.apache.coyote.AbstractProcessor.flush.

Annotations
@Override
flushBufferedWriteback to summary
protected final boolean flushBufferedWrite() throws IOException

Implements abstract org.apache.coyote.AbstractProcessor.flushBufferedWrite.

Doc from org.apache.coyote.AbstractProcessor.flushBufferedWrite.

Flush any pending writes. Used during non-blocking writes to flush any remaining data from a previous incomplete write.

Returns:boolean

true if data remains to be flushed at the end of method

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs while attempting to flush the data
getLogback to summary
protected final Log getLog()

Implements abstract org.apache.coyote.AbstractProcessorLight.getLog.

Annotations
@Override
getProtocolRequestIdback to summary
protected String getProtocolRequestId()

Overrides org.apache.coyote.AbstractProcessor.getProtocolRequestId.

Doc from org.apache.coyote.AbstractProcessor.getProtocolRequestId.

Protocols that provide per HTTP request IDs (e.g. Stream ID for HTTP/2) should override this method and return the appropriate ID.

Returns:String

The ID associated with this request or the empty string if no such ID is defined

Annotations
@Override
getServletConnectionback to summary
protected ServletConnection getServletConnection()

Implements abstract org.apache.coyote.AbstractProcessor.getServletConnection.

Doc from org.apache.coyote.AbstractProcessor.getServletConnection.

Protocols must override this method and return an appropriate ServletConnection instance

Returns:ServletConnection

the ServletConnection instance associated with the current request.

Annotations
@Override
isPushSupportedback to summary
protected final boolean isPushSupported()

Overrides org.apache.coyote.AbstractProcessor.isPushSupported.

Doc from org.apache.coyote.AbstractProcessor.isPushSupported.

Protocols that support push should override this method and return true.

Returns:boolean

true if push is supported by this processor, otherwise false.

Annotations
@Override
isReadyForReadback to summary
protected final boolean isReadyForRead()

Overrides org.apache.coyote.AbstractProcessor.isReadyForRead.

Annotations
@Override
isReadyForWriteback to summary
protected final boolean isReadyForWrite()

Implements abstract org.apache.coyote.AbstractProcessor.isReadyForWrite.

Annotations
@Override
isRequestBodyFullyReadback to summary
protected final boolean isRequestBodyFullyRead()

Implements abstract org.apache.coyote.AbstractProcessor.isRequestBodyFullyRead.

Annotations
@Override
isTrailerFieldsReadyback to summary
protected boolean isTrailerFieldsReady()

Implements abstract org.apache.coyote.AbstractProcessor.isTrailerFieldsReady.

Annotations
@Override
isTrailerFieldsSupportedback to summary
protected boolean isTrailerFieldsSupported()

Overrides org.apache.coyote.AbstractProcessor.isTrailerFieldsSupported.

Doc from org.apache.coyote.AbstractProcessor.isTrailerFieldsSupported.

Protocols that support trailer fields should override this method and return true.

Returns:boolean

true if trailer fields are supported by this processor, otherwise false.

Annotations
@Override
pauseback to summary
public final void pause()

Implements org.apache.coyote.Processor.pause.

Doc from org.apache.coyote.Processor.pause.

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.

Annotations
@Override
prepareHeadersback to summary
pack-priv static void prepareHeaders(Request coyoteRequest, Response coyoteResponse, boolean noSendfile, Http2Protocol protocol, Stream stream)
prepareResponseback to summary
protected final void prepareResponse() throws IOException

Implements abstract org.apache.coyote.AbstractProcessor.prepareResponse.

Annotations
@Override
prepareSendfileback to summary
private void prepareSendfile()
processback to summary
pack-priv final void process(SocketEvent event)
processSocketEventback to summary
protected void processSocketEvent(SocketEvent event, boolean dispatch)

Overrides org.apache.coyote.AbstractProcessor.processSocketEvent.

Annotations
@Override
recycleback to summary
public final void recycle()

Overrides org.apache.coyote.AbstractProcessor.recycle.

Implements org.apache.coyote.Processor.recycle.

Doc from org.apache.coyote.Processor.recycle.

Recycle the processor, ready for the next request which may be on the same connection or a different connection.

Annotations
@Override
registerReadInterestback to summary
protected final void registerReadInterest()

Implements abstract org.apache.coyote.AbstractProcessor.registerReadInterest.

Annotations
@Override
serviceback to summary
public final AbstractEndpoint.Handler.SocketState service(SocketWrapperBase<?> socket) throws IOException

Implements abstract org.apache.coyote.AbstractProcessorLight.service.

Doc from org.apache.coyote.AbstractProcessorLight.service.

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 dispatch(SocketEvent). Requests may be pipe-lined.

Parameters
socket:SocketWrapperBase<?>

The connection to process

Returns:AbstractEndpoint.Handler.SocketState

The state the caller should put the socket in when this method returns

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs during the processing of the request
setRequestBodyback to summary
protected final void setRequestBody(ByteChunk body)

Implements abstract org.apache.coyote.AbstractProcessor.setRequestBody.

Annotations
@Override
setSwallowResponseback to summary
protected final void setSwallowResponse()

Implements abstract org.apache.coyote.AbstractProcessor.setSwallowResponse.

Annotations
@Override
validateRequestback to summary
private boolean validateRequest()