@UnstableApi @ChannelHandler.Sharable public class Http2StreamFrameToHttpObjectCodec extends MessageToMessageCodec<Http2StreamFrame,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.ChannelHandler.Sharable| 构造器和说明 |
|---|
Http2StreamFrameToHttpObjectCodec(boolean isServer) |
Http2StreamFrameToHttpObjectCodec(boolean isServer,
boolean validateHeaders) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
acceptInboundMessage(java.lang.Object msg)
Returns
true if and only if the specified message can be decoded by this codec. |
protected void |
decode(ChannelHandlerContext ctx,
Http2StreamFrame frame,
java.util.List<java.lang.Object> out) |
protected void |
encode(ChannelHandlerContext ctx,
HttpObject obj,
java.util.List<java.lang.Object> out)
Encode from an
HttpObject to an Http2StreamFrame. |
void |
handlerAdded(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
protected boolean |
isSsl(ChannelHandlerContext ctx) |
acceptOutboundMessage, channelRead, writebind, close, connect, deregister, disconnect, flush, readchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerRemovedpublic Http2StreamFrameToHttpObjectCodec(boolean isServer,
boolean validateHeaders)
public Http2StreamFrameToHttpObjectCodec(boolean isServer)
public boolean acceptInboundMessage(java.lang.Object msg)
throws java.lang.Exception
MessageToMessageCodectrue if and only if the specified message can be decoded by this codec.acceptInboundMessage 在类中 MessageToMessageCodec<Http2StreamFrame,HttpObject>msg - the messagejava.lang.Exceptionprotected void decode(ChannelHandlerContext ctx, Http2StreamFrame frame, java.util.List<java.lang.Object> out) throws java.lang.Exception
decode 在类中 MessageToMessageCodec<Http2StreamFrame,HttpObject>java.lang.ExceptionMessageToMessageDecoder.decode(ChannelHandlerContext, Object, List)protected void encode(ChannelHandlerContext ctx, HttpObject obj, java.util.List<java.lang.Object> out) throws java.lang.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 在类中 MessageToMessageCodec<Http2StreamFrame,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 aggregationjava.lang.Exception - is thrown if an error occursMessageToMessageEncoder.encode(ChannelHandlerContext, Object, List)public void handlerAdded(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandlerAdapterhandlerAdded 在接口中 ChannelHandlerhandlerAdded 在类中 ChannelHandlerAdapterjava.lang.Exceptionprotected boolean isSsl(ChannelHandlerContext ctx)