@UnstableApi 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| Constructor and Description |
|---|
Http2StreamFrameToHttpObjectCodec(boolean isServer) |
Http2StreamFrameToHttpObjectCodec(boolean isServer,
boolean validateHeaders) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptInboundMessage(Object msg)
Returns
true if and only if the specified message can be decoded by this codec. |
protected void |
decode(ChannelHandlerContext ctx,
Http2StreamFrame frame,
List<Object> out) |
protected void |
encode(ChannelHandlerContext ctx,
HttpObject obj,
List<Object> out) |
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(Object msg) throws Exception
MessageToMessageCodectrue if and only if the specified message can be decoded by this codec.acceptInboundMessage in class MessageToMessageCodec<Http2StreamFrame,HttpObject>msg - the messageExceptionprotected void decode(ChannelHandlerContext ctx, Http2StreamFrame frame, List<Object> out) throws Exception
decode in class MessageToMessageCodec<Http2StreamFrame,HttpObject>ExceptionMessageToMessageDecoder.decode(ChannelHandlerContext, Object, List)protected void encode(ChannelHandlerContext ctx, HttpObject obj, List<Object> out) throws Exception
encode in class MessageToMessageCodec<Http2StreamFrame,HttpObject>ExceptionMessageToMessageEncoder.encode(ChannelHandlerContext, Object, List)public void handlerAdded(ChannelHandlerContext ctx) throws Exception
ChannelHandlerAdapterhandlerAdded in interface ChannelHandlerhandlerAdded in class ChannelHandlerAdapterExceptionprotected boolean isSsl(ChannelHandlerContext ctx)
Copyright © 2008–2017 The Netty Project. All rights reserved.