@UnstableApi public abstract class AbstractMemcacheObjectEncoder<M extends MemcacheMessage> extends MessageToMessageEncoder<java.lang.Object>
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| 构造器和说明 |
|---|
AbstractMemcacheObjectEncoder() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
acceptOutboundMessage(java.lang.Object msg)
Returns
true if the given message should be handled. |
protected void |
encode(ChannelHandlerContext ctx,
java.lang.Object msg,
java.util.List<java.lang.Object> out)
Encode from one message to an other.
|
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, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedprotected void encode(ChannelHandlerContext ctx, java.lang.Object msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageEncoderencode 在类中 MessageToMessageEncoder<java.lang.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 aggregationjava.lang.Exception - is thrown if an error occurspublic boolean acceptOutboundMessage(java.lang.Object msg)
throws java.lang.Exception
MessageToMessageEncodertrue if the given message should be handled. If false it will be passed to the next
ChannelOutboundHandler in the ChannelPipeline.acceptOutboundMessage 在类中 MessageToMessageEncoder<java.lang.Object>java.lang.Exceptionprotected abstract ByteBuf encodeMessage(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.