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, inputClosed, onPostAdd, onPreRemove, sessionClosed, sessionCreated, sessionIdle, sessionOpened, toStringpublic 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 IoFilteronPreAdd in class IoFilterAdapterExceptionpublic void onPostRemove(IoFilterChain parent, String name, IoFilter.NextFilter nextFilter) throws Exception
onPostRemove in interface IoFilteronPostRemove in class IoFilterAdapterExceptionpublic void messageReceived(IoFilter.NextFilter nextFilter, IoSession session, Object message) throws Exception
messageReceived in interface IoFiltermessageReceived in class IoFilterAdapterExceptionpublic void messageSent(IoFilter.NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception
messageSent in interface IoFiltermessageSent in class IoFilterAdapterExceptionCopyright © 2006-2012 The Red5 Project