Class BinaryMemcacheClientCodec
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.netty.channel.CombinedChannelDuplexHandler<BinaryMemcacheResponseDecoder, BinaryMemcacheRequestEncoder>
io.netty.handler.codec.memcache.binary.BinaryMemcacheClientCodec
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler, ChannelOutboundHandler
@UnstableApi
public final class BinaryMemcacheClientCodec
extends CombinedChannelDuplexHandler<BinaryMemcacheResponseDecoder, BinaryMemcacheRequestEncoder>
The client codec that combines the proper encoder and decoder.
Use this codec if you want to implement a memcache client that speaks the binary protocol. It
combines both the
BinaryMemcacheResponseDecoder and the BinaryMemcacheRequestEncoder.
Optionally, it counts the number of outstanding responses and raises an exception if - on connection
close - the list is not 0 (this is turned off by default). You can also define a chunk size for the
content, which defaults to 8192. This chunk size is the maximum, so if smaller chunks arrive they
will be passed up the pipeline and not queued up to the chunk size.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.SharableModifier and TypeInterfaceDescriptionstatic @interfaceIndicates that the same instance of the annotatedChannelHandlercan be added to one or moreChannelPipelines multiple times without a race condition. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newBinaryMemcacheClientCodecwith the default settings applied.BinaryMemcacheClientCodec(int decodeChunkSize) Create a newBinaryMemcacheClientCodecand set a custom chunk size.BinaryMemcacheClientCodec(int decodeChunkSize, boolean failOnMissingResponse) Create a newBinaryMemcacheClientCodecwith custom settings. -
Method Summary
Methods inherited from class CombinedChannelDuplexHandler
bind, channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, handlerAdded, handlerRemoved, inboundHandler, init, outboundHandler, read, removeInboundHandler, removeOutboundHandler, userEventTriggered, writeModifier and TypeMethodDescriptionvoidbind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) CallsChannelOutboundInvoker.bind(SocketAddress, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelActive()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidchannelRead(ChannelHandlerContext ctx, Object msg) CallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelReadComplete()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelRegistered()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelUnregistered()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelWritabilityChanged()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidclose(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.close(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidconnect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) CallsChannelOutboundInvoker.connect(SocketAddress, SocketAddress, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidderegister(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.deregister(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voiddisconnect(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.disconnect(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidexceptionCaught(ChannelHandlerContext ctx, Throwable cause) CallsChannelHandlerContext.fireExceptionCaught(Throwable)to forward to the nextChannelHandlerin theChannelPipeline.voidCallsChannelHandlerContext.flush()to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidDo nothing by default, sub-classes may override this method.voidDo nothing by default, sub-classes may override this method.protected final BinaryMemcacheResponseDecoderprotected final voidinit(BinaryMemcacheResponseDecoder inboundHandler, BinaryMemcacheRequestEncoder outboundHandler) Initialized this handler with the specified handlers.protected final BinaryMemcacheRequestEncodervoidCallsChannelHandlerContext.read()to forward to the nextChannelOutboundHandlerin theChannelPipeline.final voidRemoves theChannelInboundHandlerthat was combined in thisCombinedChannelDuplexHandler.final voidRemoves theChannelOutboundHandlerthat was combined in thisCombinedChannelDuplexHandler.voiduserEventTriggered(ChannelHandlerContext ctx, Object evt) CallsChannelHandlerContext.fireUserEventTriggered(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.voidwrite(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) CallsChannelOutboundInvoker.write(Object, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.Methods inherited from class ChannelHandlerAdapter
ensureNotSharable, isSharableModifier and TypeMethodDescriptionprotected voidbooleanReturntrueif the implementation isChannelHandler.Sharableand so can be added to differentChannelPipelines.
-
Constructor Details
-
BinaryMemcacheClientCodec
public BinaryMemcacheClientCodec()Create a newBinaryMemcacheClientCodecwith the default settings applied. -
BinaryMemcacheClientCodec
public BinaryMemcacheClientCodec(int decodeChunkSize) Create a newBinaryMemcacheClientCodecand set a custom chunk size.- Parameters:
decodeChunkSize- the maximum chunk size.
-
BinaryMemcacheClientCodec
public BinaryMemcacheClientCodec(int decodeChunkSize, boolean failOnMissingResponse) Create a newBinaryMemcacheClientCodecwith custom settings.- Parameters:
decodeChunkSize- the maximum chunk size.failOnMissingResponse- report if after close there are outstanding requests.
-