@ChannelHandler.Sharable public class GlobalTrafficShapingHandler extends AbstractTrafficShapingHandler
AbstractTrafficShapingHandler is for global
traffic shaping, that is to say a global limitation of the bandwidth, whatever
the number of opened channels.release() once this handler is not needed anymore to release all internal resources.
This will not shutdown the EventExecutor as it may be shared, so you need to do this by your own.checkInterval, DEFAULT_CHECK_INTERVAL, trafficCounter| Constructor and Description |
|---|
GlobalTrafficShapingHandler(io.netty.util.concurrent.EventExecutor executor)
Create a new instance
|
GlobalTrafficShapingHandler(ScheduledExecutorService executor,
long checkInterval)
Create a new instance
|
GlobalTrafficShapingHandler(ScheduledExecutorService executor,
long writeLimit,
long readLimit)
Create a new instance
|
GlobalTrafficShapingHandler(ScheduledExecutorService executor,
long writeLimit,
long readLimit,
long checkInterval)
Create a new instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
release()
Release all internal resources of this instance
|
calculateSize, channelRead, configure, configure, configure, doAccounting, read, toString, trafficCounter, writebind, close, connect, deregister, disconnect, flushchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredhandlerAdded, handlerRemoved, isSharablepublic GlobalTrafficShapingHandler(ScheduledExecutorService executor, long writeLimit, long readLimit, long checkInterval)
executor - the ScheduledExecutorService to use for the TrafficCounterwriteLimit - 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 GlobalTrafficShapingHandler(ScheduledExecutorService executor, long writeLimit, long readLimit)
executor - the ScheduledExecutorService to use for the TrafficCounterwriteLimit - 0 or a limit in bytes/sreadLimit - 0 or a limit in bytes/spublic GlobalTrafficShapingHandler(ScheduledExecutorService executor, long checkInterval)
executor - the ScheduledExecutorService to use for the TrafficCountercheckInterval - The delay between two computations of performances for
channels or 0 if no stats are to be computedpublic GlobalTrafficShapingHandler(io.netty.util.concurrent.EventExecutor executor)
executor - the ScheduledExecutorService to use for the TrafficCounterCopyright © 2008–2013 The Netty Project. All rights reserved.