org.red5.server.net.filter
Class TrafficShapingFilter
java.lang.Object
org.apache.mina.core.filterchain.IoFilterAdapter
org.red5.server.net.filter.TrafficShapingFilter
- All Implemented Interfaces:
- IoFilter
public class TrafficShapingFilter
- extends IoFilterAdapter
An IoFilter
that limits bandwidth (bytes per second) related with
read and write operations on a per-session basis.
It is always recommended to add this filter in the first place of the
IoFilterChain
.
This originated from the Mina sandbox.
Field Summary |
protected static org.slf4j.Logger |
log
|
Methods inherited from class org.apache.mina.core.filterchain.IoFilterAdapter |
destroy, exceptionCaught, filterClose, filterWrite, init, onPostAdd, onPreRemove, sessionClosed, sessionCreated, sessionIdle, sessionOpened, toString |
log
protected static org.slf4j.Logger log
TrafficShapingFilter
public TrafficShapingFilter(int maxReadThroughput,
int maxWriteThroughput)
TrafficShapingFilter
public TrafficShapingFilter(ScheduledExecutorService scheduledExecutor,
int maxReadThroughput,
int maxWriteThroughput)
TrafficShapingFilter
public TrafficShapingFilter(ScheduledExecutorService scheduledExecutor,
MessageSizeEstimator messageSizeEstimator,
int maxReadThroughput,
int maxWriteThroughput)
getScheduledExecutor
public ScheduledExecutorService getScheduledExecutor()
getMessageSizeEstimator
public MessageSizeEstimator getMessageSizeEstimator()
getMaxReadThroughput
public int getMaxReadThroughput()
setMaxReadThroughput
public void setMaxReadThroughput(int maxReadThroughput)
getMaxWriteThroughput
public int getMaxWriteThroughput()
setMaxWriteThroughput
public void setMaxWriteThroughput(int maxWriteThroughput)
getPoolSize
public int getPoolSize()
setPoolSize
public void setPoolSize(int poolSize)
onPreAdd
public void onPreAdd(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
throws Exception
- Specified by:
onPreAdd
in interface IoFilter
- Overrides:
onPreAdd
in class IoFilterAdapter
- Throws:
Exception
onPostRemove
public void onPostRemove(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter)
throws Exception
- Specified by:
onPostRemove
in interface IoFilter
- Overrides:
onPostRemove
in class IoFilterAdapter
- Throws:
Exception
messageReceived
public void messageReceived(IoFilter.NextFilter nextFilter,
IoSession session,
Object message)
throws Exception
- Specified by:
messageReceived
in interface IoFilter
- Overrides:
messageReceived
in class IoFilterAdapter
- Throws:
Exception
messageSent
public void messageSent(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest)
throws Exception
- Specified by:
messageSent
in interface IoFilter
- Overrides:
messageSent
in class IoFilterAdapter
- Throws:
Exception
Copyright © 2006-2012 The Red5 Project