net.tomp2p.utils
Class ChannelTrafficShapingHandler

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

@ChannelHandler.Sharable
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 net.tomp2p.utils.AbstractTrafficShapingHandler
checkInterval, DEFAULT_CHECK_INTERVAL, executor, trafficCounter
 
Constructor Summary
ChannelTrafficShapingHandler(Executor executor)
           
ChannelTrafficShapingHandler(Executor executor, long checkInterval)
           
ChannelTrafficShapingHandler(Executor executor, long writeLimit, long readLimit)
           
ChannelTrafficShapingHandler(Executor executor, long writeLimit, long readLimit, long checkInterval)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator, Executor executor)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator, Executor executor, long checkInterval)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator, Executor executor, long writeLimit, long readLimit)
           
ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator, Executor executor, 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 net.tomp2p.utils.AbstractTrafficShapingHandler
configure, configure, configure, doAccounting, getTrafficCounter, handleDownstream, hasLimit, 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(Executor executor,
                                    long writeLimit,
                                    long readLimit,
                                    long checkInterval)
Parameters:
executor -
writeLimit -
readLimit -
checkInterval -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(Executor executor,
                                    long writeLimit,
                                    long readLimit)
Parameters:
executor -
writeLimit -
readLimit -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(Executor executor,
                                    long checkInterval)
Parameters:
executor -
checkInterval -

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(Executor executor)
Parameters:
executor -

ChannelTrafficShapingHandler

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

ChannelTrafficShapingHandler

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

ChannelTrafficShapingHandler

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

ChannelTrafficShapingHandler

public ChannelTrafficShapingHandler(org.jboss.netty.util.ObjectSizeEstimator objectSizeEstimator,
                                    Executor executor)
Parameters:
objectSizeEstimator -
executor -
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 © 2011. All Rights Reserved.