@UnstableApi public abstract class AbstractBinaryMemcacheDecoder<M extends BinaryMemcacheMessage> extends AbstractMemcacheObjectDecoder
BinaryMemcacheRequest和BinaryMemcacheResponse的解码器。
协议(标题)中的差异由子类实现。
ByteToMessageDecoder.CumulatorChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_CHUNK_SIZE |
COMPOSITE_CUMULATOR, MERGE_CUMULATOR| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBinaryMemcacheDecoder()
用默认设置创建一个新的 AbstractBinaryMemcacheDecoder 。
|
protected |
AbstractBinaryMemcacheDecoder(int chunkSize)
用自定义设置创建一个新的 AbstractBinaryMemcacheDecoder 。
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract M |
buildInvalidMessage()
当传入分析失败时,Helper方法创建上游消息。
|
void |
channelInactive(ChannelHandlerContext ctx)
当通道不活动时,释放所有帧以防止数据泄漏。
|
protected void |
decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out)
解码从一个 ByteBuf到另一个。
|
protected abstract M |
decodeHeader(ByteBuf in)
解码并返回解析的 BinaryMemcacheMessage 。
|
protected void |
resetDecoder()
准备下一次解码迭代。
|
actualReadableBytes, callDecode, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, handlerAdded, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAddedpublic static final int DEFAULT_MAX_CHUNK_SIZE
protected AbstractBinaryMemcacheDecoder()
AbstractBinaryMemcacheDecoder 。
protected AbstractBinaryMemcacheDecoder(int chunkSize)
AbstractBinaryMemcacheDecoder 。
chunkSize - 有效负载的最大块大小。
protected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
ByteToMessageDecoder
decode在课程
ByteToMessageDecoder
ctx - 这是ByteToMessageDecoder所属的ChannelHandlerContext
in - 从中读取数据的ByteBuf
out - 应该添加解码消息的
List
java.lang.Exception - 发生错误时抛出
public void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
channelInactive ,界面
ChannelInboundHandler
channelInactive在课程
ByteToMessageDecoder
ctx - 处理程序上下文
java.lang.Exception
protected void resetDecoder()
protected abstract M decodeHeader(ByteBuf in)
BinaryMemcacheMessage 。
in - 传入缓冲区。
protected abstract M buildInvalidMessage()
Copyright © 2008–2018 The Netty Project. All rights reserved.