org.jboss.netty.handler.traffic
Class ChannelTrafficShapingHandler

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelHandler
      extended by org.jboss.netty.handler.traffic.AbstractTrafficShapingHandler
          extended by org.jboss.netty.handler.traffic.ChannelTrafficShapingHandler
All Implemented Interfaces:
org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler, org.jboss.netty.util.ExternalResourceReleasable

public class ChannelTrafficShapingHandler
extends AbstractTrafficShapingHandler

This implementation of the AbstractTrafficShapingHandler is for channel traffic shaping, that is to say a per channel limitation of the bandwidth.

The general use should be as follow:


Author:
The Netty Project (netty-dev@lists.jboss.org), Frederic Bregier

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Field Summary
 
Fields inherited from class org.jboss.netty.handler.traffic.AbstractTrafficShapingHandler
checkInterval, DEFAULT_CHECK_INTERVAL, timer, trafficCounter
 
Constructor Summary
ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator, org.jboss.netty.util.Timer timer)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator, org.jboss.netty.util.Timer timer, long checkInterval)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator, org.jboss.netty.util.Timer timer, long writeLimit, long readLimit)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator, org.jboss.netty.util.Timer timer, long writeLimit, long readLimit, long checkInterval)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.Timer timer)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.Timer timer, long checkInterval)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.Timer timer, long writeLimit, long readLimit)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.Timer timer, long writeLimit, long readLimit, long checkInterval)
           
 
Method Summary
 void channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e)
           
 void channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e)
           
 
Methods inherited from class org.jboss.netty.handler.traffic.AbstractTrafficShapingHandler
configure, configure, configure, doAccounting, getTrafficCounter, handleDownstream, messageReceived, releaseExternalResources, toString, writeRequested
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelHandler
bindRequested, channelBound, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, exceptionCaught, handleUpstream, setInterestOpsRequested, unbindRequested, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(org.jboss.netty.util.Timer timer,
                                    long writeLimit,
                                    long readLimit,
                                    long checkInterval)
Parameters:
timer -
writeLimit -
readLimit -
checkInterval -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(org.jboss.netty.util.Timer timer,
                                    long writeLimit,
                                    long readLimit)
Parameters:
timer -
writeLimit -
readLimit -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(org.jboss.netty.util.Timer timer,
                                    long checkInterval)
Parameters:
timer -
checkInterval -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(org.jboss.netty.util.Timer timer)
Parameters:
timer -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator,
                                    org.jboss.netty.util.Timer timer,
                                    long writeLimit,
                                    long readLimit,
                                    long checkInterval)
Parameters:
objectSizeEstimator -
timer -
writeLimit -
readLimit -
checkInterval -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator,
                                    org.jboss.netty.util.Timer timer,
                                    long writeLimit,
                                    long readLimit)
Parameters:
objectSizeEstimator -
timer -
writeLimit -
readLimit -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator,
                                    org.jboss.netty.util.Timer timer,
                                    long checkInterval)
Parameters:
objectSizeEstimator -
timer -
checkInterval -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator,
                                    org.jboss.netty.util.Timer timer)
Parameters:
objectSizeEstimator -
timer -
Method Detail

channelClosed

public void channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx,
                          org.jboss.netty.channel.ChannelStateEvent e)
                   throws Exception
Overrides:
channelClosed in class org.jboss.netty.channel.SimpleChannelHandler
Throws:
Exception

channelConnected

public void channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
                             org.jboss.netty.channel.ChannelStateEvent e)
                      throws Exception
Overrides:
channelConnected in class org.jboss.netty.channel.SimpleChannelHandler
Throws:
Exception


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.