Http2FrameCodec.
When a new stream is created, a new Channel is created for it. Applications send and
receive Http2StreamFrames on the created channel. Buffers cannot be processed by the channel;
all writes that reach the head of the pipeline must be an instance of Http2StreamFrame. Writes that reach
the head of the pipeline are processed directly by this handler and cannot be intercepted.
The child channel will be notified of user events that impact the stream, such as Http2GoAwayFrame and Http2ResetFrame, as soon as they occur. Although Http2GoAwayFrame and Http2ResetFrame signify that the remote is ignoring further
communication, closing of the channel is delayed until any inbound queue is drained with ChannelOutboundInvoker#read(ReadBufferAllocator), which follows the default behavior of channels in Netty.
Applications are free to close the channel in response to such events if they don't have use for any queued
messages. Any connection level events like Http2SettingsFrame and Http2GoAwayFrame
will be processed internally and also propagated down the pipeline for other handlers to act on.
Outbound streams are supported via the Http2StreamChannelBootstrap.
ChannelOption#AUTO_READ is supported.
Http2StreamFrames implement the Resource interface, as they carry
resource objects (e.g. Buffers). An application handler needs to close or dispose of
such objects after having consumed them.
EventLoop. Therefore, an active channel
does not map to an active HTTP/2 stream immediately. Only once a Http2HeadersFrame has been successfully sent
or received, does the channel map to an active HTTP/2 stream. In case it is not possible to open a new HTTP/2 stream
(i.e. due to the maximum number of active streams being exceeded), the child channel receives an exception
indicating the cause and is closed immediately thereafter.
ChannelHandlers are free to ignore the channel's writability, in which case the excessive writes will
be buffered by the parent channel. It's important to note that only Http2DataFrames are subject to
HTTP/2 flow control.
| Modifier and Type | Field and Description |
|---|---|
| private static final FutureContextListener | |
| private volatile ChannelHandlerContext | |
| private int | |
| private final ChannelHandler | |
| private boolean | |
| private final Queue | |
| private final ChannelHandler |
| Access | Constructor and Description |
|---|---|
| public | Http2MultiplexHandler(ChannelHandler
the inboundStreamHandler)ChannelHandler that will be added to the ChannelPipeline of
the Channels created for new inbound streams.Creates a new instance |
| public | Http2MultiplexHandler(ChannelHandler
the inboundStreamHandler, ChannelHandler upgradeStreamHandler)ChannelHandler that will be added to the ChannelPipeline of
the Channels created for new inbound streams.Creates a new instance |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public void | channelExceptionCaught(ChannelHandlerContext ctx, final Throwable cause)
Overrides default io. Throwable was thrown when handling inbound events.
|
| public void | channelInboundEvent(ChannelHandlerContext ctx, Object evt)
Overrides default io. |
| public void | channelRead(ChannelHandlerContext ctx, Object msg)
Overrides default io. Channel has read a message from the peer.
|
| public void | channelReadComplete(ChannelHandlerContext ctx)
Overrides default io. |
| public void | channelWritabilityChanged(final ChannelHandlerContext ctx)
Overrides default io. Channel changed.
|
| private void | |
| protected void | |
| protected void | |
| pack-priv boolean | |
| private static boolean | |
| pack-priv Http2StreamChannel | |
| private void | |
| pack-priv ChannelHandlerContext | |
| private void | |
| private static void |
| CHILD_CHANNEL_REGISTRATION_LISTENER | back to summary |
|---|---|
| private static final FutureContextListener<Channel, Void> CHILD_CHANNEL_REGISTRATION_LISTENER | |
| ctx | back to summary |
|---|---|
| private volatile ChannelHandlerContext ctx | |
| idCount | back to summary |
|---|---|
| private int idCount | |
| inboundStreamHandler | back to summary |
|---|---|
| private final ChannelHandler inboundStreamHandler | |
| parentReadInProgress | back to summary |
|---|---|
| private boolean parentReadInProgress | |
| readCompletePendingQueue | back to summary |
|---|---|
| private final Queue<DefaultHttp2StreamChannel> readCompletePendingQueue | |
| upgradeStreamHandler | back to summary |
|---|---|
| private final ChannelHandler upgradeStreamHandler | |
| Http2MultiplexHandler | back to summary |
|---|---|
| public Http2MultiplexHandler(ChannelHandler inboundStreamHandler) Creates a new instance
| |
| Http2MultiplexHandler | back to summary |
|---|---|
| public Http2MultiplexHandler(ChannelHandler inboundStreamHandler, ChannelHandler upgradeStreamHandler) Creates a new instance
| |
| addChannelToReadCompletePendingQueue | back to summary |
|---|---|
| pack-priv void addChannelToReadCompletePendingQueue(DefaultHttp2StreamChannel channel) | |
| channelExceptionCaught | back to summary |
|---|---|
| public void channelExceptionCaught(ChannelHandlerContext ctx, final Throwable cause) throws Exception Overrides default io. Doc from io. Gets called if a
| |
| channelInboundEvent | back to summary |
|---|---|
| public void channelInboundEvent(ChannelHandlerContext ctx, Object evt) throws Exception Overrides default io. Doc from io. Gets called if a custom inbound event happened.
| |
| channelRead | back to summary |
|---|---|
| public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception Overrides default io. Doc from io. Invoked when the current
| |
| channelReadComplete | back to summary |
|---|---|
| public void channelReadComplete(ChannelHandlerContext ctx) throws Exception Overrides default io. Notifies any child streams of the read completion.
| |
| channelWritabilityChanged | back to summary |
|---|---|
| public void channelWritabilityChanged(final ChannelHandlerContext ctx) throws Exception Overrides default io. Doc from io. Gets called once the writable state of a
| |
| createStreamChannelIfNeeded | back to summary |
|---|---|
| private void createStreamChannelIfNeeded(Http2FrameCodec. | |
| handlerAdded0 | back to summary |
|---|---|
| protected void handlerAdded0(ChannelHandlerContext ctx) Overrides io.
| |
| handlerRemoved0 | back to summary |
|---|---|
| protected void handlerRemoved0(ChannelHandlerContext ctx) Overrides io.
| |
| isParentReadInProgress | back to summary |
|---|---|
| pack-priv boolean isParentReadInProgress() | |
| isServer | back to summary |
|---|---|
| private static boolean isServer(ChannelHandlerContext ctx) | |
| newOutboundStream | back to summary |
|---|---|
| pack-priv Http2StreamChannel newOutboundStream() | |
| onHttp2GoAwayFrame | back to summary |
|---|---|
| private void onHttp2GoAwayFrame(ChannelHandlerContext ctx, final Http2GoAwayFrame goAwayFrame) | |
| parentContext | back to summary |
|---|---|
| pack-priv ChannelHandlerContext parentContext() | |
| processPendingReadCompleteQueue | back to summary |
|---|---|
| private void processPendingReadCompleteQueue() | |
| registerDone | back to summary |
|---|---|
| private static void registerDone(Channel childChannel, Future<?> future) | |