public class TrafficShapingFilter extends IoFilterAdapter
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.
IoFilter.NextFilter
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
TrafficShapingFilter(int maxReadThroughput,
int maxWriteThroughput) |
TrafficShapingFilter(ScheduledExecutorService scheduledExecutor,
int maxReadThroughput,
int maxWriteThroughput) |
TrafficShapingFilter(ScheduledExecutorService scheduledExecutor,
MessageSizeEstimator messageSizeEstimator,
int maxReadThroughput,
int maxWriteThroughput) |
Modifier and Type | Method and Description |
---|---|
int |
getMaxReadThroughput() |
int |
getMaxWriteThroughput() |
MessageSizeEstimator |
getMessageSizeEstimator() |
int |
getPoolSize() |
ScheduledExecutorService |
getScheduledExecutor() |
void |
messageReceived(IoFilter.NextFilter nextFilter,
IoSession session,
Object message) |
void |
messageSent(IoFilter.NextFilter nextFilter,
IoSession session,
WriteRequest writeRequest) |
void |
onPostRemove(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter) |
void |
onPreAdd(IoFilterChain parent,
String name,
IoFilter.NextFilter nextFilter) |
void |
setMaxReadThroughput(int maxReadThroughput) |
void |
setMaxWriteThroughput(int maxWriteThroughput) |
void |
setPoolSize(int poolSize) |
destroy, exceptionCaught, filterClose, filterWrite, init, onPostAdd, onPreRemove, sessionClosed, sessionCreated, sessionIdle, sessionOpened, toString
public TrafficShapingFilter(int maxReadThroughput, int maxWriteThroughput)
public TrafficShapingFilter(ScheduledExecutorService scheduledExecutor, int maxReadThroughput, int maxWriteThroughput)
public TrafficShapingFilter(ScheduledExecutorService scheduledExecutor, MessageSizeEstimator messageSizeEstimator, int maxReadThroughput, int maxWriteThroughput)
public ScheduledExecutorService getScheduledExecutor()
public MessageSizeEstimator getMessageSizeEstimator()
public int getMaxReadThroughput()
public void setMaxReadThroughput(int maxReadThroughput)
public int getMaxWriteThroughput()
public void setMaxWriteThroughput(int maxWriteThroughput)
public int getPoolSize()
public void setPoolSize(int poolSize)
public void onPreAdd(IoFilterChain parent, String name, IoFilter.NextFilter nextFilter) throws Exception
onPreAdd
in interface IoFilter
onPreAdd
in class IoFilterAdapter
Exception
public void onPostRemove(IoFilterChain parent, String name, IoFilter.NextFilter nextFilter) throws Exception
onPostRemove
in interface IoFilter
onPostRemove
in class IoFilterAdapter
Exception
public void messageReceived(IoFilter.NextFilter nextFilter, IoSession session, Object message) throws Exception
messageReceived
in interface IoFilter
messageReceived
in class IoFilterAdapter
Exception
public void messageSent(IoFilter.NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception
messageSent
in interface IoFilter
messageSent
in class IoFilterAdapter
Exception
Copyright © 2006-2012 The Red5 Project