@UnstableApi public abstract class AbstractMemcacheObjectEncoder<M extends MemcacheMessage> extends io.netty.handler.codec.MessageToMessageEncoder<Object>
AbstractMemcacheObjectEncoder
that encodes MemcacheMessage
s.
Note that this class is designed to be extended, especially because both the binary and ascii protocol require different treatment of their messages. Since the content chunk writing is the same for both, the encoder abstracts this right away.
Constructor and Description |
---|
AbstractMemcacheObjectEncoder() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptOutboundMessage(Object msg) |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
List<Object> out) |
protected abstract io.netty.buffer.ByteBuf |
encodeMessage(io.netty.channel.ChannelHandlerContext ctx,
M msg)
Take the given
MemcacheMessage and encode it into a writable ByteBuf . |
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
protected void encode(io.netty.channel.ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception
protected abstract io.netty.buffer.ByteBuf encodeMessage(io.netty.channel.ChannelHandlerContext ctx, M msg)
MemcacheMessage
and encode it into a writable ByteBuf
.ctx
- the channel handler context.msg
- the message to encode.ByteBuf
representation of the message.Copyright © 2008–2021 The Netty Project. All rights reserved.