public class ChannelTrafficShapingHandler extends AbstractTrafficShapingHandler
AbstractTrafficShapingHandler
is for channel
traffic shaping, that is to say a per channel limitation of the bandwidth.ChannelHandler.Sharable
checkInterval, DEFAULT_CHECK_INTERVAL, trafficCounter
Constructor and Description |
---|
ChannelTrafficShapingHandler(long checkInterval)
Create a new instance
|
ChannelTrafficShapingHandler(long writeLimit,
long readLimit)
Create a new instance
|
ChannelTrafficShapingHandler(long writeLimit,
long readLimit,
long checkInterval)
Create a new instance
|
Modifier and Type | Method and Description |
---|---|
void |
handlerAdded(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
void |
handlerRemoved(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
calculateSize, channelRead, configure, configure, configure, doAccounting, read, toString, trafficCounter, write
bind, close, connect, deregister, disconnect, flush
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
exceptionCaught
public ChannelTrafficShapingHandler(long writeLimit, long readLimit, long checkInterval)
writeLimit
- 0 or a limit in bytes/sreadLimit
- 0 or a limit in bytes/scheckInterval
- The delay between two computations of performances for
channels or 0 if no stats are to be computedpublic ChannelTrafficShapingHandler(long writeLimit, long readLimit)
writeLimit
- 0 or a limit in bytes/sreadLimit
- 0 or a limit in bytes/spublic ChannelTrafficShapingHandler(long checkInterval)
checkInterval
- The delay between two computations of performances for
channels or 0 if no stats are to be computedpublic void handlerAdded(ChannelHandlerContext ctx) throws Exception
ChannelHandlerAdapter
handlerAdded
in interface ChannelHandler
handlerAdded
in class ChannelHandlerAdapter
Exception
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception
ChannelHandlerAdapter
handlerRemoved
in interface ChannelHandler
handlerRemoved
in class ChannelHandlerAdapter
Exception
Copyright © 2008–2013 The Netty Project. All rights reserved.