Package org.ldaptive.transport.netty
Class AutoReadFlowControlHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.ldaptive.transport.netty.AutoReadFlowControlHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
final class AutoReadFlowControlHandler
extends io.netty.channel.ChannelDuplexHandler
Keeps a counter of messages that have been sent down the pipeline. That counter is decremented whenever a read is
requested. A read is only propagated to the channel when all messages have completed. This handler is intended to be
used with
NettyConnection.AutoReadEventHandler.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LoggerLogger for this class.private final AtomicIntegerNumber of messages in the pipeline. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) voidread(io.netty.channel.ChannelHandlerContext ctx) Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, writeMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
logger
Logger for this class. -
messageCount
Number of messages in the pipeline.
-
-
Constructor Details
-
AutoReadFlowControlHandler
AutoReadFlowControlHandler()
-
-
Method Details
-
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
read
- Specified by:
readin interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
readin classio.netty.channel.ChannelDuplexHandler- Throws:
Exception
-