Package io.netty.handler.codec.memcache
Class AbstractMemcacheObjectAggregator<H extends MemcacheMessage>
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.MessageToMessageDecoder<I>
-
- io.netty.handler.codec.MessageAggregator<MemcacheObject,H,MemcacheContent,FullMemcacheMessage>
-
- io.netty.handler.codec.memcache.AbstractMemcacheObjectAggregator<H>
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
BinaryMemcacheObjectAggregator
@UnstableApi public abstract class AbstractMemcacheObjectAggregator<H extends MemcacheMessage> extends io.netty.handler.codec.MessageAggregator<MemcacheObject,H,MemcacheContent,FullMemcacheMessage>
AChannelHandlerthat aggregates anMemcacheMessageand its followingMemcacheContents into a singleMemcacheMessagewith no followingMemcacheContents. It is useful when you don't want to take care of memcache messages where the content comes along in chunks. Insert this handler after a AbstractMemcacheObjectDecoder in theChannelPipeline. For example, here for the binary protocol:ChannelPipelinep = ...; ... p.addLast("decoder", newBinaryMemcacheRequestDecoder()); p.addLast("aggregator", newBinaryMemcacheObjectAggregator(1048576) ); ... p.addLast("encoder", newBinaryMemcacheResponseEncoder()); p.addLast("handler", new YourMemcacheRequestHandler());
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMemcacheObjectAggregator(int maxContentLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancloseAfterContinueResponse(Object msg)protected booleanignoreContentAfterContinueResponse(Object msg)protected booleanisAggregated(MemcacheObject msg)protected booleanisContentLengthInvalid(H start, int maxContentLength)protected booleanisContentMessage(MemcacheObject msg)protected booleanisLastContentMessage(MemcacheContent msg)protected ObjectnewContinueResponse(H start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline)-
Methods inherited from class io.netty.handler.codec.MessageAggregator
acceptInboundMessage, aggregate, beginAggregation, channelInactive, channelReadComplete, ctx, decode, finishAggregation, handleOversizedMessage, handlerAdded, handlerRemoved, isHandlingOversizedMessage, isStartMessage, maxContentLength, maxCumulationBufferComponents, releaseCurrentMessage, setMaxCumulationBufferComponents
-
-
-
-
Method Detail
-
isContentMessage
protected boolean isContentMessage(MemcacheObject msg) throws Exception
- Specified by:
isContentMessagein classio.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>- Throws:
Exception
-
isLastContentMessage
protected boolean isLastContentMessage(MemcacheContent msg) throws Exception
- Specified by:
isLastContentMessagein classio.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>- Throws:
Exception
-
isAggregated
protected boolean isAggregated(MemcacheObject msg) throws Exception
- Specified by:
isAggregatedin classio.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>- Throws:
Exception
-
isContentLengthInvalid
protected boolean isContentLengthInvalid(H start, int maxContentLength)
- Specified by:
isContentLengthInvalidin classio.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>
-
newContinueResponse
protected Object newContinueResponse(H start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline)
- Specified by:
newContinueResponsein classio.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>
-
closeAfterContinueResponse
protected boolean closeAfterContinueResponse(Object msg) throws Exception
- Specified by:
closeAfterContinueResponsein classio.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>- Throws:
Exception
-
ignoreContentAfterContinueResponse
protected boolean ignoreContentAfterContinueResponse(Object msg) throws Exception
- Specified by:
ignoreContentAfterContinueResponsein classio.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>- Throws:
Exception
-
-