public abstract class HttpObjectEncoder<H extends HttpMessage> extends MessageToMessageEncoder<Object>
HttpMessage or an HttpContent into
a ByteBuf.
ChannelHandler.Sharable, ChannelHandler.Skip| Constructor and Description |
|---|
HttpObjectEncoder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptOutboundMessage(Object msg)
Returns
true if the given message should be handled. |
protected void |
encode(ChannelHandlerContext ctx,
Object msg,
List<Object> out)
Encode from one message to an other.
|
protected void |
encodeHeaders(HttpHeaders headers,
ByteBuf buf)
Encode the
HttpHeaders into a ByteBuf. |
protected abstract void |
encodeInitialLine(ByteBuf buf,
H message) |
writebind, channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, handlerAdded, handlerRemoved, isSharable, read, userEventTriggeredprotected void encode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception
MessageToMessageEncoderencode in class MessageToMessageEncoder<Object>ctx - the ChannelHandlerContext which this MessageToMessageEncoder belongs tomsg - the message to encode to an other oneout - the List into which the encoded msg should be added
needs to do some kind of aggragationException - is thrown if an error accourprotected void encodeHeaders(HttpHeaders headers, ByteBuf buf) throws Exception
HttpHeaders into a ByteBuf.Exceptionpublic boolean acceptOutboundMessage(Object msg) throws Exception
MessageToMessageEncodertrue if the given message should be handled. If false it will be passed to the next
ChannelHandler in the ChannelPipeline.acceptOutboundMessage in class MessageToMessageEncoder<Object>ExceptionCopyright © 2008–2015 The Netty Project. All rights reserved.