Top Inners Fields Constructors Methods
org.apache.coyote.http2

public Class Http2AsyncUpgradeHandler

extends Http2UpgradeHandler
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.CompletionHandler, .FileChannel, .FileChannel.MapMode, java.nio.file.StandardOpenOption, java.util.ArrayList, .List, java.util.concurrent.TimeUnit, java.util.concurrent.atomic.AtomicReference, java.util.concurrent.locks.Lock, .ReentrantLock, jakarta.servlet.http.WebConnection, org.apache.coyote.Adapter, .ProtocolException, .Request, org.apache.tomcat.util.http.MimeHeaders, org.apache.tomcat.util.net.SendfileState, .SocketWrapperBase, .SocketWrapperBase.BlockingMode, .SocketWrapperBase.CompletionState

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
protected class
protected class

Field Summary

Modifier and TypeField and Description
private final CompletionHandler<Long, Void>
private final AtomicReference<IOException>
private static final ByteBuffer[]
private final AtomicReference<Throwable>
private final CompletionHandler<Long, Void>
private final Lock
private final Lock
Inherited from org.apache.coyote.http2.Http2UpgradeHandler:
activeRemoteStreamCountconnectionIdFLAG_END_OF_HEADERSFLAG_END_OF_STREAMGOAWAYHEADER_SINKlocalSettingslogPINGPING_ACKprotocolSETTINGS_ACKsmsocketWrapperuserDataHelper

Constructor Summary

AccessConstructor and Description
public
Http2AsyncUpgradeHandler(Http2Protocol protocol, Adapter adapter, Request coyoteRequest, SocketWrapperBase<?> socketWrapper)

Method Summary

Modifier and TypeMethod and Description
protected Http2UpgradeHandler.HeaderFrameBuffers
protected Http2Parser
protected Http2UpgradeHandler.PingManager
private void
public boolean
protected void
pack-priv void
protected SendfileState
processSendfile(SendfileData
The stream and associated data to process
sendfile
)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.processSendfile.

Process send file (if supported) for the given stream.

pack-priv void
public void
pack-priv void
writeBody(Stream stream, ByteBuffer data, int len, boolean finished)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeBody.

protected void
writeGoAwayFrame(int maxStreamId, long errorCode, byte[] debugMsg)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeGoAwayFrame.

pack-priv void
writeHeaders(Stream stream, int pushedStreamId, MimeHeaders mimeHeaders, boolean endOfStream, int payloadSize)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeHeaders.

protected void
writeSettings()

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeSettings.

Write the initial settings frame and any necessary supporting frames.

pack-priv void
writeWindowUpdate(AbstractNonZeroStream stream, int increment, boolean applicationInitiated)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeWindowUpdate.

Inherited from org.apache.coyote.http2.Http2UpgradeHandler:
checkPauseStatecloseConnectioncreateWindowUpdateForSettingsdecrementActiveRemoteStreamCountdestroydoWriteHeadersendRequestBodyFrameexecuteQueuedStreamfillgetConnectionIdgetHpackDecodergetHpackEncodergetLocalSettingsgetMaxFrameSizegetProtocolgetRemoteSettingsgetServletConnectiongoawayhandleAppInitiatedIOExceptionheadersContinueheadersEndheadersStartincreaseOverheadCountincrementWindowSizeincrementWindowSizeinitisOverheadLimitExceededonSwallowedDataFramePayloadonSwallowedUnknownFramepausepingReceivepriorityUpdateprocessStreamOnContainerThreadprocessStreamOnContainerThreadprocessWritespushreceivedEndOfStreamreduceOverheadCountreplaceStreamreprioritisereserveWindowSizeresetsentEndOfStreamsetConnectionTimeoutForStreamCountsetSocketWrappersetSslSupportsettingstartRequestBodyFrametimeoutAsyncupgradeDispatch

Field Detail

applicationErrorCompletionback to summary
private final CompletionHandler<Long, Void> applicationErrorCompletion
applicationIOEback to summary
private final AtomicReference<IOException> applicationIOE
BYTEBUFFER_ARRAYback to summary
private static final ByteBuffer[] BYTEBUFFER_ARRAY
errorback to summary
private final AtomicReference<Throwable> error
errorCompletionback to summary
private final CompletionHandler<Long, Void> errorCompletion
headerWriteLockback to summary
private final Lock headerWriteLock
sendResetLockback to summary
private final Lock sendResetLock

Constructor Detail

Http2AsyncUpgradeHandlerback to summary
public Http2AsyncUpgradeHandler(Http2Protocol protocol, Adapter adapter, Request coyoteRequest, SocketWrapperBase<?> socketWrapper)

Method Detail

getHeaderFrameBuffersback to summary
protected Http2UpgradeHandler.HeaderFrameBuffers getHeaderFrameBuffers(int initialPayloadSize)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.getHeaderFrameBuffers.

Annotations
@Override
getParserback to summary
protected Http2Parser getParser(String connectionId)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.getParser.

Annotations
@Override
getPingManagerback to summary
protected Http2UpgradeHandler.PingManager getPingManager()

Overrides org.apache.coyote.http2.Http2UpgradeHandler.getPingManager.

Annotations
@Override
handleAsyncExceptionback to summary
private void handleAsyncException() throws IOException
hasAsyncIOback to summary
public boolean hasAsyncIO()

Overrides default org.apache.coyote.http11.upgrade.InternalHttpUpgradeHandler.hasAsyncIO.

Annotations
@Override
processConnectionback to summary
protected void processConnection(WebConnection webConnection, Stream stream)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.processConnection.

Annotations
@Override
processConnectionCallbackback to summary
pack-priv void processConnectionCallback(WebConnection webConnection, Stream stream)
processSendfileback to summary
protected SendfileState processSendfile(SendfileData sendfile)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.processSendfile.

Doc from org.apache.coyote.http2.Http2UpgradeHandler.processSendfile.

Process send file (if supported) for the given stream. The appropriate request attributes should be set before calling this method.

Parameters
sendfile:SendfileData

The stream and associated data to process

Returns:SendfileState

The result of the send file processing

Annotations
@Override
sendStreamResetback to summary
pack-priv void sendStreamReset(StreamStateMachine state, StreamException se) throws IOException

Overrides org.apache.coyote.http2.Http2UpgradeHandler.sendStreamReset.

Annotations
@Override
settingsEndback to summary
public void settingsEnd(boolean ack) throws IOException

Overrides org.apache.coyote.http2.Http2UpgradeHandler.settingsEnd.

Implements org.apache.coyote.http2.Http2Parser.Output.settingsEnd.

Annotations
@Override
writeBodyback to summary
pack-priv void writeBody(Stream stream, ByteBuffer data, int len, boolean finished) throws IOException

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeBody.

Annotations
@Override
writeGoAwayFrameback to summary
protected void writeGoAwayFrame(int maxStreamId, long errorCode, byte[] debugMsg) throws IOException

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeGoAwayFrame.

Annotations
@Override
writeHeadersback to summary
pack-priv void writeHeaders(Stream stream, int pushedStreamId, MimeHeaders mimeHeaders, boolean endOfStream, int payloadSize) throws IOException

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeHeaders.

Annotations
@Override
writeSettingsback to summary
protected void writeSettings()

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeSettings.

Doc from org.apache.coyote.http2.Http2UpgradeHandler.writeSettings.

Write the initial settings frame and any necessary supporting frames. If the initial settings increase the initial window size, it will also be necessary to send a WINDOW_UPDATE frame to increase the size of the flow control window for the connection (stream 0).

Annotations
@Override
writeWindowUpdateback to summary
pack-priv void writeWindowUpdate(AbstractNonZeroStream stream, int increment, boolean applicationInitiated) throws IOException

Overrides org.apache.coyote.http2.Http2UpgradeHandler.writeWindowUpdate.

Annotations
@Override
org.apache.coyote.http2 back to summary

private Class Http2AsyncUpgradeHandler.AsyncHeaderFrameBuffers

extends Object
implements HeaderFrameBuffers
Class Inheritance
  • java.lang.Object
  • org.apache.coyote.http2.Http2AsyncUpgradeHandler.AsyncHeaderFrameBuffers
All Implemented Interfaces
org.apache.coyote.http2.Http2UpgradeHandler.HeaderFrameBuffers

Field Summary

Modifier and TypeField and Description
private final List<ByteBuffer>
private byte[]
private ByteBuffer
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
AsyncHeaderFrameBuffers(int initialPayloadSize)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public byte[]
public ByteBuffer
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufsback to summary
private final List<ByteBuffer> bufs
headerback to summary
private byte[] header
payloadback to summary
private ByteBuffer payload
payloadSizeback to summary
pack-priv int payloadSize

Constructor Detail

AsyncHeaderFrameBuffersback to summary
pack-priv AsyncHeaderFrameBuffers(int initialPayloadSize)

Method Detail

endFrameback to summary
public void endFrame() throws IOException

Implements org.apache.coyote.http2.Http2UpgradeHandler.HeaderFrameBuffers.endFrame.

Annotations
@Override
endHeadersback to summary
public void endHeaders() throws IOException

Implements org.apache.coyote.http2.Http2UpgradeHandler.HeaderFrameBuffers.endHeaders.

Annotations
@Override
expandPayloadback to summary
public void expandPayload()

Implements org.apache.coyote.http2.Http2UpgradeHandler.HeaderFrameBuffers.expandPayload.

Annotations
@Override
getHeaderback to summary
public byte[] getHeader()

Implements org.apache.coyote.http2.Http2UpgradeHandler.HeaderFrameBuffers.getHeader.

Annotations
@Override
getPayloadback to summary
public ByteBuffer getPayload()

Implements org.apache.coyote.http2.Http2UpgradeHandler.HeaderFrameBuffers.getPayload.

Annotations
@Override
startFrameback to summary
public void startFrame()

Implements org.apache.coyote.http2.Http2UpgradeHandler.HeaderFrameBuffers.startFrame.

Annotations
@Override
org.apache.coyote.http2 back to summary

protected Class Http2AsyncUpgradeHandler.AsyncPingManager

extends PingManager
Class Inheritance

Field Summary

Inherited from org.apache.coyote.http2.Http2UpgradeHandler.PingManager:
inflightPingsinitiateDisabledlastPingNanoTimepingIntervalNanoroundTripTimessequence

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
public void
sendPing(boolean
Send a ping, even if one was sent recently
force
)

Overrides org.apache.coyote.http2.Http2UpgradeHandler.PingManager.sendPing.

Check to see if a ping was sent recently and, if not, send one.

Inherited from org.apache.coyote.http2.Http2UpgradeHandler.PingManager:
getRoundTripTimeNano

Constructor Detail

AsyncPingManagerback to summary
protected AsyncPingManager()

Method Detail

receivePingback to summary
public void receivePing(byte[] payload, boolean ack) throws IOException

Overrides org.apache.coyote.http2.Http2UpgradeHandler.PingManager.receivePing.

Annotations
@Override
sendPingback to summary
public void sendPing(boolean force) throws IOException

Overrides org.apache.coyote.http2.Http2UpgradeHandler.PingManager.sendPing.

Doc from org.apache.coyote.http2.Http2UpgradeHandler.PingManager.sendPing.

Check to see if a ping was sent recently and, if not, send one.

Parameters
force:boolean

Send a ping, even if one was sent recently

Annotations
@Override
Exceptions
IOException:
If an I/O issue prevents the ping from being sent
org.apache.coyote.http2 back to summary

protected Class Http2AsyncUpgradeHandler.SendfileCompletionHandler

extends Object
implements CompletionHandler<Long, SendfileData>
Class Inheritance
  • java.lang.Object
  • org.apache.coyote.http2.Http2AsyncUpgradeHandler.SendfileCompletionHandler
All Implemented Interfaces
java.nio.channels.CompletionHandler

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
completed(Long
The result of the I/O operation.
nBytes
,
SendfileData
The object attached to the I/O operation when it was initiated.
sendfile
)

Implements java.nio.channels.CompletionHandler.completed.

Invoked when an operation has completed.

public void
failed(Throwable
The exception to indicate why the I/O operation failed
t
,
SendfileData
The object attached to the I/O operation when it was initiated.
sendfile
)

Implements java.nio.channels.CompletionHandler.failed.

Invoked when an operation fails.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SendfileCompletionHandlerback to summary
protected SendfileCompletionHandler()

Method Detail

completedback to summary
public void completed(Long nBytes, SendfileData sendfile)

Implements java.nio.channels.CompletionHandler.completed.

Doc from java.nio.channels.CompletionHandler.completed.

Invoked when an operation has completed.

Parameters
nBytes:Long

The result of the I/O operation.

sendfile:SendfileData

The object attached to the I/O operation when it was initiated.

Annotations
@Override
failedback to summary
public void failed(Throwable t, SendfileData sendfile)

Implements java.nio.channels.CompletionHandler.failed.

Doc from java.nio.channels.CompletionHandler.failed.

Invoked when an operation fails.

Parameters
t:Throwable

The exception to indicate why the I/O operation failed

sendfile:SendfileData

The object attached to the I/O operation when it was initiated.

Annotations
@Override