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

pack-priv Class Http2AsyncParser

extends Http2Parser
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.CompletionHandler, java.util.concurrent.TimeUnit, jakarta.servlet.http.WebConnection, org.apache.coyote.ProtocolException, org.apache.tomcat.util.net.SocketEvent, .SocketWrapperBase, .SocketWrapperBase.BlockingMode, .SocketWrapperBase.CompletionCheck, .SocketWrapperBase.CompletionHandlerCall, .SocketWrapperBase.CompletionState

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private volatile Throwable
private final SocketWrapperBase<?>
private final Http2AsyncUpgradeHandler
Inherited from org.apache.coyote.http2.Http2Parser:
CLIENT_PREFACE_STARTconnectionIdinputlogsm

Constructor Summary

AccessConstructor and Description
pack-priv
Http2AsyncParser(String connectionId, Http2Parser.Input input, Http2Parser.Output output, SocketWrapperBase<?> socketWrapper, Http2AsyncUpgradeHandler upgradeHandler)

Method Summary

Modifier and TypeMethod and Description
private void
pack-priv void
readConnectionPreface(WebConnection
The connection
webConnection
,
Stream
The current stream
stream
)

Overrides org.apache.coyote.http2.Http2Parser.readConnectionPreface.

Read and validate the connection preface from input using blocking IO.

protected boolean
Inherited from org.apache.coyote.http2.Http2Parser:
onHeadersCompletereadContinuationFramereadDataFramereadFramereadFramereadGoawayFramereadHeaderPayloadreadHeadersFramereadPingFramereadPriorityFramereadPriorityUpdateFramereadPushPromiseFramereadRstFramereadSettingsFramereadUnknownFramereadWindowUpdateFrameswallowPayloadvalidateFrame

Field Detail

errorback to summary
private volatile Throwable error
socketWrapperback to summary
private final SocketWrapperBase<?> socketWrapper
upgradeHandlerback to summary
private final Http2AsyncUpgradeHandler upgradeHandler

Constructor Detail

Http2AsyncParserback to summary
pack-priv Http2AsyncParser(String connectionId, Http2Parser.Input input, Http2Parser.Output output, SocketWrapperBase<?> socketWrapper, Http2AsyncUpgradeHandler upgradeHandler)

Method Detail

handleAsyncExceptionback to summary
private void handleAsyncException() throws IOException, Http2Exception
readConnectionPrefaceback to summary
pack-priv void readConnectionPreface(WebConnection webConnection, Stream stream) throws Http2Exception

Overrides org.apache.coyote.http2.Http2Parser.readConnectionPreface.

Doc from org.apache.coyote.http2.Http2Parser.readConnectionPreface.

Read and validate the connection preface from input using blocking IO.

Parameters
webConnection:WebConnection

The connection

stream:Stream

The current stream

Annotations
@Override
readFrameback to summary
protected boolean readFrame(boolean block, FrameType expected) throws IOException, Http2Exception

Overrides org.apache.coyote.http2.Http2Parser.readFrame.

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

private Class Http2AsyncParser.FrameCompletionHandler

extends Object
implements CompletionCheck, CompletionHandler<Long, Void>
Class Inheritance
  • java.lang.Object
  • org.apache.coyote.http2.Http2AsyncParser.FrameCompletionHandler
All Implemented Interfaces
java.nio.channels.CompletionHandler, org.apache.tomcat.util.net.SocketWrapperBase.CompletionCheck
Known Direct Subclasses
org.apache.coyote.http2.Http2AsyncParser.PrefaceCompletionHandler

Field Summary

Modifier and TypeField and Description
protected final ByteBuffer[]
private final FrameType
protected volatile int
protected volatile FrameType
protected volatile int
private volatile boolean
protected volatile int
private volatile SocketWrapperBase.CompletionState
protected volatile boolean
protected volatile int
private volatile boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public SocketWrapperBase.CompletionHandlerCall
callHandler(SocketWrapperBase.CompletionState
of the operation (done or done in-line since the IO call is done)
state
,
ByteBuffer[]
ByteBuffer[] that has been passed to the original IO call
buffers
,
int
that has been passed to the original IO call
offset
,
int
that has been passed to the original IO call
length
)

Implements org.apache.tomcat.util.net.SocketWrapperBase.CompletionCheck.callHandler.

Determine what call, if any, should be made to the completion handler.

public void
completed(Long
The result of the I/O operation.
result
,
Void
The object attached to the I/O operation when it was initiated.
attachment
)

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
e
,
Void
The object attached to the I/O operation when it was initiated.
attachment
)

Implements java.nio.channels.CompletionHandler.failed.

Invoked when an operation fails.

protected SocketWrapperBase.CompletionHandlerCall
validate(SocketWrapperBase.CompletionState state, ByteBuffer frameHeaderBuffer, ByteBuffer payload)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

buffersback to summary
protected final ByteBuffer[] buffers
expectedback to summary
private final FrameType expected
flagsback to summary
protected volatile int flags
frameTypeback to summary
protected volatile FrameType frameType
frameTypeIdback to summary
protected volatile int frameTypeId
parsedFrameHeaderback to summary
private volatile boolean parsedFrameHeader
payloadSizeback to summary
protected volatile int payloadSize
stateback to summary
private volatile SocketWrapperBase.CompletionState state
streamExceptionback to summary
protected volatile boolean streamException
streamIdback to summary
protected volatile int streamId
validatedback to summary
private volatile boolean validated

Constructor Detail

FrameCompletionHandlerback to summary
private FrameCompletionHandler(FrameType expected, ByteBuffer... buffers)

Method Detail

callHandlerback to summary
public SocketWrapperBase.CompletionHandlerCall callHandler(SocketWrapperBase.CompletionState state, ByteBuffer[] buffers, int offset, int length)

Implements org.apache.tomcat.util.net.SocketWrapperBase.CompletionCheck.callHandler.

Doc from org.apache.tomcat.util.net.SocketWrapperBase.CompletionCheck.callHandler.

Determine what call, if any, should be made to the completion handler.

Parameters
state:SocketWrapperBase.CompletionState

of the operation (done or done in-line since the IO call is done)

buffers:ByteBuffer[]

ByteBuffer[] that has been passed to the original IO call

offset:int

that has been passed to the original IO call

length:int

that has been passed to the original IO call

Returns:SocketWrapperBase.CompletionHandlerCall

The call, if any, to make to the completion handler

Annotations
@Override
completedback to summary
public void completed(Long result, Void attachment)

Implements java.nio.channels.CompletionHandler.completed.

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

Invoked when an operation has completed.

Parameters
result:Long

The result of the I/O operation.

attachment:Void

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

Annotations
@Override
failedback to summary
public void failed(Throwable e, Void attachment)

Implements java.nio.channels.CompletionHandler.failed.

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

Invoked when an operation fails.

Parameters
e:Throwable

The exception to indicate why the I/O operation failed

attachment:Void

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

Annotations
@Override
validateback to summary
protected SocketWrapperBase.CompletionHandlerCall validate(SocketWrapperBase.CompletionState state, ByteBuffer frameHeaderBuffer, ByteBuffer payload)
org.apache.coyote.http2 back to summary

private Class Http2AsyncParser.PrefaceCompletionHandler

extends FrameCompletionHandler
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final byte[]
private volatile boolean
private final Stream
private final WebConnection
Inherited from org.apache.coyote.http2.Http2AsyncParser.FrameCompletionHandler:
buffersflagsframeTypeframeTypeIdpayloadSizestreamExceptionstreamId

Constructor Summary

AccessConstructor and Description
private
PrefaceCompletionHandler(WebConnection webConnection, Stream stream, byte[] prefaceData, ByteBuffer... buffers)

Method Summary

Modifier and TypeMethod and Description
public SocketWrapperBase.CompletionHandlerCall
callHandler(SocketWrapperBase.CompletionState
of the operation (done or done in-line since the IO call is done)
state
,
ByteBuffer[]
ByteBuffer[] that has been passed to the original IO call
buffers
,
int
that has been passed to the original IO call
offset
,
int
that has been passed to the original IO call
length
)

Overrides org.apache.coyote.http2.Http2AsyncParser.FrameCompletionHandler.callHandler.

Implements org.apache.tomcat.util.net.SocketWrapperBase.CompletionCheck.callHandler.

Determine what call, if any, should be made to the completion handler.

public void
completed(Long
The result of the I/O operation.
result
,
Void
The object attached to the I/O operation when it was initiated.
attachment
)

Overrides org.apache.coyote.http2.Http2AsyncParser.FrameCompletionHandler.completed.

Implements java.nio.channels.CompletionHandler.completed.

Invoked when an operation has completed.

Inherited from org.apache.coyote.http2.Http2AsyncParser.FrameCompletionHandler:
failedvalidate

Field Detail

prefaceDataback to summary
private final byte[] prefaceData
prefaceValidatedback to summary
private volatile boolean prefaceValidated
streamback to summary
private final Stream stream
webConnectionback to summary
private final WebConnection webConnection

Constructor Detail

PrefaceCompletionHandlerback to summary
private PrefaceCompletionHandler(WebConnection webConnection, Stream stream, byte[] prefaceData, ByteBuffer... buffers)

Method Detail

callHandlerback to summary
public SocketWrapperBase.CompletionHandlerCall callHandler(SocketWrapperBase.CompletionState state, ByteBuffer[] buffers, int offset, int length)

Overrides org.apache.coyote.http2.Http2AsyncParser.FrameCompletionHandler.callHandler.

Implements org.apache.tomcat.util.net.SocketWrapperBase.CompletionCheck.callHandler.

Doc from org.apache.tomcat.util.net.SocketWrapperBase.CompletionCheck.callHandler.

Determine what call, if any, should be made to the completion handler.

Parameters
state:SocketWrapperBase.CompletionState

of the operation (done or done in-line since the IO call is done)

buffers:ByteBuffer[]

ByteBuffer[] that has been passed to the original IO call

offset:int

that has been passed to the original IO call

length:int

that has been passed to the original IO call

Returns:SocketWrapperBase.CompletionHandlerCall

The call, if any, to make to the completion handler

Annotations
@Override
completedback to summary
public void completed(Long result, Void attachment)

Overrides org.apache.coyote.http2.Http2AsyncParser.FrameCompletionHandler.completed.

Implements java.nio.channels.CompletionHandler.completed.

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

Invoked when an operation has completed.

Parameters
result:Long

The result of the I/O operation.

attachment:Void

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

Annotations
@Override