@ChannelHandler.Sharable public class Http2StreamFrameToHttpObjectCodec extends io.netty.handler.codec.MessageToMessageCodec<Http2StreamFrame,io.netty.handler.codec.http.HttpObject>
Http2StreamFrame to HttpObject,
and back. It can be used as an adapter in conjunction with Http2MultiplexCodec to make http/2 connections backward-compatible with
ChannelHandlers expecting HttpObject
For simplicity, it converts to chunked encoding unless the entire stream
is a single header.| Constructor and Description |
|---|
Http2StreamFrameToHttpObjectCodec(boolean isServer) |
Http2StreamFrameToHttpObjectCodec(boolean isServer,
boolean validateHeaders) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptInboundMessage(Object msg) |
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
Http2StreamFrame frame,
List<Object> out) |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpObject obj,
List<Object> out)
Encode from an
HttpObject to an Http2StreamFrame. |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
protected boolean |
isSsl(io.netty.channel.ChannelHandlerContext ctx) |
acceptOutboundMessage, channelRead, channelReadComplete, writebind, close, connect, deregister, disconnect, flush, readchannelActive, channelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerRemoved, isSharablepublic Http2StreamFrameToHttpObjectCodec(boolean isServer,
boolean validateHeaders)
public Http2StreamFrameToHttpObjectCodec(boolean isServer)
public boolean acceptInboundMessage(Object msg) throws Exception
acceptInboundMessage in class io.netty.handler.codec.MessageToMessageCodec<Http2StreamFrame,io.netty.handler.codec.http.HttpObject>Exceptionprotected void decode(io.netty.channel.ChannelHandlerContext ctx,
Http2StreamFrame frame,
List<Object> out)
throws Exception
decode in class io.netty.handler.codec.MessageToMessageCodec<Http2StreamFrame,io.netty.handler.codec.http.HttpObject>Exceptionprotected void encode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpObject obj,
List<Object> out)
throws Exception
HttpObject to an Http2StreamFrame. This method will
be called for each written message that can be handled by this encoder.
NOTE: 100-Continue responses that are NOT FullHttpResponse will be rejected.encode in class io.netty.handler.codec.MessageToMessageCodec<Http2StreamFrame,io.netty.handler.codec.http.HttpObject>ctx - the ChannelHandlerContext which this handler belongs toobj - the HttpObject message to encodeout - the List into which the encoded msg should be added
needs to do some kind of aggregationException - is thrown if an error occurspublic void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterExceptionprotected boolean isSsl(io.netty.channel.ChannelHandlerContext ctx)
Copyright © 2008–2025 The Netty Project. All rights reserved.