public abstract class AbstractMemcacheObjectEncoder<M extends MemcacheMessage> extends MessageToMessageEncoder<Object>
A general purpose AbstractMemcacheObjectEncoder that encodes MemcacheMessages.
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.
ChannelHandler.Sharable| Constructor and Description |
|---|
AbstractMemcacheObjectEncoder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptOutboundMessage(Object msg) |
protected void |
encode(ChannelHandlerContext ctx,
Object msg,
List<Object> out) |
protected abstract ByteBuf |
encodeMessage(ChannelHandlerContext ctx,
M msg)
Take the given
MemcacheMessage and encode it into a writable ByteBuf. |
writebind, close, connect, deregister, disconnect, flush, readexceptionCaught, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedprotected void encode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception
encode in class MessageToMessageEncoder<Object>Exceptionpublic boolean acceptOutboundMessage(Object msg) throws Exception
acceptOutboundMessage in class MessageToMessageEncoder<Object>Exceptionprotected abstract ByteBuf encodeMessage(ChannelHandlerContext ctx, M msg)
Take the given MemcacheMessage and encode it into a writable ByteBuf.
ctx - the channel handler context.msg - the message to encode.ByteBuf representation of the message.Copyright © 2016 Couchbase, Inc.. All rights reserved.