public class ReadThrottleFilterBuilder
extends java.lang.Object
IoSession
once the data
batched for that session in the ExecutorFilter
reaches a defined threshold (the
default is 1 megabytes). It accomplishes this by being in the filter chain before
and after the ExecutorFilter
. It is possible to subvert the
behavior of this filter by adding filters immediately after the ExecutorFilter
after adding this filter. Thus, it is recommended to add this filter towards the end of
your filter chain construction, if you need to ensure that other filters need to be right
after the ExecutorFilter
Usage:
DefaultFilterChainBuilder builder = ...
ReadThrottleFilterBuilder filter = new ReadThrottleFilterBuilder();
filter.attach( builder );
or
IoFilterChain chain = ...
ReadThrottleFilterBuilder filter = new ReadThrottleFilterBuilder();
filter.attach( chain );
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COUNTER |
static java.lang.String |
SUSPENDED_READS |
Constructor and Description |
---|
ReadThrottleFilterBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
attach(DefaultIoFilterChainBuilder builder)
Attach this filter to the specified builder.
|
void |
attach(IoFilterChain chain)
Attach this filter to the specified filter chain.
|
void |
setMaximumConnectionBufferSize(int maximumConnectionBufferSize)
Set the maximum amount of data to buffer in the ThreadPoolFilter prior to disabling
reads.
|
public static final java.lang.String COUNTER
public static final java.lang.String SUSPENDED_READS
public void setMaximumConnectionBufferSize(int maximumConnectionBufferSize)
maximumConnectionBufferSize
- New buffer size. Must be > 0public void attach(IoFilterChain chain)
chain
- IoFilterChain
to attach self to.public void attach(DefaultIoFilterChainBuilder builder)
ExecutorFilter
, and attach itself before and after that filter.builder
- DefaultIoFilterChainBuilder
to attach self to.Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.