@UnstableApi public abstract class AbstractMemcacheObjectAggregator<H extends MemcacheMessage> extends io.netty.handler.codec.MessageAggregator<MemcacheObject,H,MemcacheContent,FullMemcacheMessage>
ChannelHandler
that aggregates an MemcacheMessage
and its following MemcacheContent
s into a single MemcacheMessage
with
no following MemcacheContent
s. 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 the ChannelPipeline
.
For example, here for the binary protocol:
ChannelPipeline
p = ...; ... p.addLast("decoder", newBinaryMemcacheRequestDecoder
()); p.addLast("aggregator", newBinaryMemcacheObjectAggregator
(1048576) ); ... p.addLast("encoder", newBinaryMemcacheResponseEncoder
()); p.addLast("handler", new YourMemcacheRequestHandler());
Modifier | Constructor and Description |
---|---|
protected |
AbstractMemcacheObjectAggregator(int maxContentLength) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
closeAfterContinueResponse(Object msg) |
protected boolean |
ignoreContentAfterContinueResponse(Object msg) |
protected boolean |
isAggregated(MemcacheObject msg) |
protected boolean |
isContentLengthInvalid(H start,
int maxContentLength) |
protected boolean |
isContentMessage(MemcacheObject msg) |
protected boolean |
isLastContentMessage(MemcacheContent msg) |
protected Object |
newContinueResponse(H start,
int maxContentLength,
io.netty.channel.ChannelPipeline pipeline) |
acceptInboundMessage, aggregate, beginAggregation, channelInactive, channelReadComplete, ctx, decode, finishAggregation, handleOversizedMessage, handlerAdded, handlerRemoved, isHandlingOversizedMessage, isStartMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponents
protected AbstractMemcacheObjectAggregator(int maxContentLength)
protected boolean isContentMessage(MemcacheObject msg) throws Exception
isContentMessage
in class io.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>
Exception
protected boolean isLastContentMessage(MemcacheContent msg) throws Exception
isLastContentMessage
in class io.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>
Exception
protected boolean isAggregated(MemcacheObject msg) throws Exception
isAggregated
in class io.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>
Exception
protected boolean isContentLengthInvalid(H start, int maxContentLength)
isContentLengthInvalid
in class io.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>
protected Object newContinueResponse(H start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline)
newContinueResponse
in class io.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>
protected boolean closeAfterContinueResponse(Object msg) throws Exception
closeAfterContinueResponse
in class io.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>
Exception
protected boolean ignoreContentAfterContinueResponse(Object msg) throws Exception
ignoreContentAfterContinueResponse
in class io.netty.handler.codec.MessageAggregator<MemcacheObject,H extends MemcacheMessage,MemcacheContent,FullMemcacheMessage>
Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.