public abstract class AbstractIoSessionConfig extends Object implements IoSessionConfig
IoSessionConfig
.Modifier | Constructor and Description |
---|---|
protected |
AbstractIoSessionConfig() |
Modifier and Type | Method and Description |
---|---|
int |
getBothIdleTime() |
long |
getBothIdleTimeInMillis() |
int |
getIdleTime(IdleStatus status) |
long |
getIdleTimeInMillis(IdleStatus status) |
int |
getMaxReadBufferSize() |
int |
getMinReadBufferSize() |
int |
getReadBufferSize() |
int |
getReaderIdleTime() |
long |
getReaderIdleTimeInMillis() |
int |
getThroughputCalculationInterval() |
long |
getThroughputCalculationIntervalInMillis() |
int |
getWriterIdleTime() |
long |
getWriterIdleTimeInMillis() |
int |
getWriteTimeout() |
long |
getWriteTimeoutInMillis() |
boolean |
isUseReadOperation() |
void |
setAll(IoSessionConfig config)
Sets all configuration properties retrieved from the specified
config.
|
void |
setBothIdleTime(int idleTime)
Sets idle time for
IdleStatus.WRITER_IDLE in seconds. |
void |
setIdleTime(IdleStatus status,
int idleTime)
Sets idle time for the specified type of idleness in seconds.
|
void |
setMaxReadBufferSize(int maxReadBufferSize)
Sets the maximum size of the read buffer that I/O processor
allocates per each read.
|
void |
setMinReadBufferSize(int minReadBufferSize)
Sets the minimum size of the read buffer that I/O processor
allocates per each read.
|
void |
setReadBufferSize(int readBufferSize)
Sets the size of the read buffer that I/O processor allocates
per each read.
|
void |
setReaderIdleTime(int idleTime)
Sets idle time for
IdleStatus.READER_IDLE in seconds. |
void |
setThroughputCalculationInterval(int throughputCalculationInterval)
Sets the interval (seconds) between each throughput calculation.
|
void |
setUseReadOperation(boolean useReadOperation)
Enables or disabled
IoSession.read() operation. |
void |
setWriterIdleTime(int idleTime)
Sets idle time for
IdleStatus.WRITER_IDLE in seconds. |
void |
setWriteTimeout(int writeTimeout)
Sets write timeout in seconds.
|
public void setAll(IoSessionConfig config)
setAll
in interface IoSessionConfig
config
- The configuration to usepublic int getReadBufferSize()
getReadBufferSize
in interface IoSessionConfig
public void setReadBufferSize(int readBufferSize)
setReadBufferSize
in interface IoSessionConfig
readBufferSize
- The size of the read bufferpublic int getMinReadBufferSize()
getMinReadBufferSize
in interface IoSessionConfig
public void setMinReadBufferSize(int minReadBufferSize)
setMinReadBufferSize
in interface IoSessionConfig
minReadBufferSize
- The minimum size of the read bufferpublic int getMaxReadBufferSize()
getMaxReadBufferSize
in interface IoSessionConfig
public void setMaxReadBufferSize(int maxReadBufferSize)
setMaxReadBufferSize
in interface IoSessionConfig
maxReadBufferSize
- The maximum size of the read bufferpublic int getIdleTime(IdleStatus status)
getIdleTime
in interface IoSessionConfig
status
- The status for which we want the idle time (One of READER_IDLE,
WRITER_IDLE or BOTH_IDLE)public long getIdleTimeInMillis(IdleStatus status)
getIdleTimeInMillis
in interface IoSessionConfig
status
- The status for which we want the idle time (One of READER_IDLE,
WRITER_IDLE or BOTH_IDLE)public void setIdleTime(IdleStatus status, int idleTime)
setIdleTime
in interface IoSessionConfig
status
- The status for which we want to set the idle time (One of READER_IDLE,
WRITER_IDLE or BOTH_IDLE)idleTime
- The time in second to setpublic final int getBothIdleTime()
getBothIdleTime
in interface IoSessionConfig
IdleStatus.BOTH_IDLE
in seconds.public final long getBothIdleTimeInMillis()
getBothIdleTimeInMillis
in interface IoSessionConfig
IdleStatus.BOTH_IDLE
in milliseconds.public final int getReaderIdleTime()
getReaderIdleTime
in interface IoSessionConfig
IdleStatus.READER_IDLE
in seconds.public final long getReaderIdleTimeInMillis()
getReaderIdleTimeInMillis
in interface IoSessionConfig
IdleStatus.READER_IDLE
in milliseconds.public final int getWriterIdleTime()
getWriterIdleTime
in interface IoSessionConfig
IdleStatus.WRITER_IDLE
in seconds.public final long getWriterIdleTimeInMillis()
getWriterIdleTimeInMillis
in interface IoSessionConfig
IdleStatus.WRITER_IDLE
in milliseconds.public void setBothIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.setBothIdleTime
in interface IoSessionConfig
idleTime
- The time to setpublic void setReaderIdleTime(int idleTime)
IdleStatus.READER_IDLE
in seconds.setReaderIdleTime
in interface IoSessionConfig
idleTime
- The time to setpublic void setWriterIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.setWriterIdleTime
in interface IoSessionConfig
idleTime
- The time to setpublic int getWriteTimeout()
getWriteTimeout
in interface IoSessionConfig
public long getWriteTimeoutInMillis()
getWriteTimeoutInMillis
in interface IoSessionConfig
public void setWriteTimeout(int writeTimeout)
setWriteTimeout
in interface IoSessionConfig
writeTimeout
- The timeout to setpublic boolean isUseReadOperation()
isUseReadOperation
in interface IoSessionConfig
IoSession.read()
operation
is enabled. If enabled, all received messages are stored in an internal
BlockingQueue
so you can read received messages in more
convenient way for client applications. Enabling this option is not
useful to server applications and can cause unintended memory leak, and
therefore it's disabled by default.public void setUseReadOperation(boolean useReadOperation)
IoSession.read()
operation. If enabled, all
received messages are stored in an internal BlockingQueue
so you
can read received messages in more convenient way for client
applications. Enabling this option is not useful to server applications
and can cause unintended memory leak, and therefore it's disabled by
default.setUseReadOperation
in interface IoSessionConfig
useReadOperation
- true if the read operation is enabled, false otherwisepublic int getThroughputCalculationInterval()
getThroughputCalculationInterval
in interface IoSessionConfig
public void setThroughputCalculationInterval(int throughputCalculationInterval)
setThroughputCalculationInterval
in interface IoSessionConfig
throughputCalculationInterval
- The intervalpublic long getThroughputCalculationIntervalInMillis()
getThroughputCalculationIntervalInMillis
in interface IoSessionConfig
Copyright © 2004–2021 Apache MINA Project. All rights reserved.