org.apache.mina.core.session
Class AbstractIoSessionConfig

java.lang.Object
  extended by org.apache.mina.core.session.AbstractIoSessionConfig
All Implemented Interfaces:
IoSessionConfig
Direct Known Subclasses:
AbstractDatagramSessionConfig, AbstractSocketSessionConfig

public abstract class AbstractIoSessionConfig
extends Object
implements IoSessionConfig

A base implementation of IoSessionConfig.

Version:
$Rev: 662867 $, $Date: 2008-06-03 21:53:20 +0200 (Tue, 03 Jun 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
protected AbstractIoSessionConfig()
           
 
Method Summary
protected abstract  void doSetAll(IoSessionConfig config)
          Implement this method to set all transport-specific configuration properties retrieved from the specified config.
 int getBothIdleTime()
          Returns idle time for IdleStatus.BOTH_IDLE in seconds.
 long getBothIdleTimeInMillis()
          Returns idle time for IdleStatus.BOTH_IDLE in milliseconds.
 int getIdleTime(IdleStatus status)
          Returns idle time for the specified type of idleness in seconds.
 long getIdleTimeInMillis(IdleStatus status)
          Returns idle time for the specified type of idleness in milliseconds.
 int getMaxReadBufferSize()
          Returns the maximum size of the read buffer that I/O processor allocates per each read.
 int getMinReadBufferSize()
          Returns the minimum size of the read buffer that I/O processor allocates per each read.
 int getReadBufferSize()
          Returns the size of the read buffer that I/O processor allocates per each read.
 int getReaderIdleTime()
          Returns idle time for IdleStatus.READER_IDLE in seconds.
 long getReaderIdleTimeInMillis()
          Returns idle time for IdleStatus.READER_IDLE in milliseconds.
 int getThroughputCalculationInterval()
          Returns the interval (seconds) between each throughput calculation.
 long getThroughputCalculationIntervalInMillis()
          Returns the interval (milliseconds) between each throughput calculation.
 int getWriterIdleTime()
          Returns idle time for IdleStatus.WRITER_IDLE in seconds.
 long getWriterIdleTimeInMillis()
          Returns idle time for IdleStatus.WRITER_IDLE in milliseconds.
 int getWriteTimeout()
          Returns write timeout in seconds.
 long getWriteTimeoutInMillis()
          Returns write timeout in milliseconds.
 boolean isUseReadOperation()
          Returns true if and only if IoSession.read() operation is enabled.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractIoSessionConfig

protected AbstractIoSessionConfig()
Method Detail

setAll

public final void setAll(IoSessionConfig config)
Sets all configuration properties retrieved from the specified config.

Specified by:
setAll in interface IoSessionConfig

doSetAll

protected abstract void doSetAll(IoSessionConfig config)
Implement this method to set all transport-specific configuration properties retrieved from the specified config.


getReadBufferSize

public int getReadBufferSize()
Returns the size of the read buffer that I/O processor allocates per each read. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.

Specified by:
getReadBufferSize in interface IoSessionConfig

setReadBufferSize

public void setReadBufferSize(int readBufferSize)
Sets the size of the read buffer that I/O processor allocates per each read. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.

Specified by:
setReadBufferSize in interface IoSessionConfig

getMinReadBufferSize

public int getMinReadBufferSize()
Returns the minimum size of the read buffer that I/O processor allocates per each read. I/O processor will not decrease the read buffer size to the smaller value than this property value.

Specified by:
getMinReadBufferSize in interface IoSessionConfig

setMinReadBufferSize

public void setMinReadBufferSize(int minReadBufferSize)
Sets the minimum size of the read buffer that I/O processor allocates per each read. I/O processor will not decrease the read buffer size to the smaller value than this property value.

Specified by:
setMinReadBufferSize in interface IoSessionConfig

getMaxReadBufferSize

public int getMaxReadBufferSize()
Returns the maximum size of the read buffer that I/O processor allocates per each read. I/O processor will not increase the read buffer size to the greater value than this property value.

Specified by:
getMaxReadBufferSize in interface IoSessionConfig

setMaxReadBufferSize

public void setMaxReadBufferSize(int maxReadBufferSize)
Sets the maximum size of the read buffer that I/O processor allocates per each read. I/O processor will not increase the read buffer size to the greater value than this property value.

Specified by:
setMaxReadBufferSize in interface IoSessionConfig

getIdleTime

public int getIdleTime(IdleStatus status)
Returns idle time for the specified type of idleness in seconds.

Specified by:
getIdleTime in interface IoSessionConfig

getIdleTimeInMillis

public long getIdleTimeInMillis(IdleStatus status)
Returns idle time for the specified type of idleness in milliseconds.

Specified by:
getIdleTimeInMillis in interface IoSessionConfig

setIdleTime

public void setIdleTime(IdleStatus status,
                        int idleTime)
Sets idle time for the specified type of idleness in seconds.

Specified by:
setIdleTime in interface IoSessionConfig

getBothIdleTime

public final int getBothIdleTime()
Returns idle time for IdleStatus.BOTH_IDLE in seconds.

Specified by:
getBothIdleTime in interface IoSessionConfig

getBothIdleTimeInMillis

public final long getBothIdleTimeInMillis()
Returns idle time for IdleStatus.BOTH_IDLE in milliseconds.

Specified by:
getBothIdleTimeInMillis in interface IoSessionConfig

getReaderIdleTime

public final int getReaderIdleTime()
Returns idle time for IdleStatus.READER_IDLE in seconds.

Specified by:
getReaderIdleTime in interface IoSessionConfig

getReaderIdleTimeInMillis

public final long getReaderIdleTimeInMillis()
Returns idle time for IdleStatus.READER_IDLE in milliseconds.

Specified by:
getReaderIdleTimeInMillis in interface IoSessionConfig

getWriterIdleTime

public final int getWriterIdleTime()
Returns idle time for IdleStatus.WRITER_IDLE in seconds.

Specified by:
getWriterIdleTime in interface IoSessionConfig

getWriterIdleTimeInMillis

public final long getWriterIdleTimeInMillis()
Returns idle time for IdleStatus.WRITER_IDLE in milliseconds.

Specified by:
getWriterIdleTimeInMillis in interface IoSessionConfig

setBothIdleTime

public void setBothIdleTime(int idleTime)
Sets idle time for IdleStatus.WRITER_IDLE in seconds.

Specified by:
setBothIdleTime in interface IoSessionConfig

setReaderIdleTime

public void setReaderIdleTime(int idleTime)
Sets idle time for IdleStatus.READER_IDLE in seconds.

Specified by:
setReaderIdleTime in interface IoSessionConfig

setWriterIdleTime

public void setWriterIdleTime(int idleTime)
Sets idle time for IdleStatus.WRITER_IDLE in seconds.

Specified by:
setWriterIdleTime in interface IoSessionConfig

getWriteTimeout

public int getWriteTimeout()
Returns write timeout in seconds.

Specified by:
getWriteTimeout in interface IoSessionConfig

getWriteTimeoutInMillis

public long getWriteTimeoutInMillis()
Returns write timeout in milliseconds.

Specified by:
getWriteTimeoutInMillis in interface IoSessionConfig

setWriteTimeout

public void setWriteTimeout(int writeTimeout)
Sets write timeout in seconds.

Specified by:
setWriteTimeout in interface IoSessionConfig

isUseReadOperation

public boolean isUseReadOperation()
Returns true if and only if 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.

Specified by:
isUseReadOperation in interface IoSessionConfig

setUseReadOperation

public void setUseReadOperation(boolean useReadOperation)
Enables or disabled 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.

Specified by:
setUseReadOperation in interface IoSessionConfig

getThroughputCalculationInterval

public int getThroughputCalculationInterval()
Returns the interval (seconds) between each throughput calculation. The default value is 3 seconds.

Specified by:
getThroughputCalculationInterval in interface IoSessionConfig

setThroughputCalculationInterval

public void setThroughputCalculationInterval(int throughputCalculationInterval)
Sets the interval (seconds) between each throughput calculation. The default value is 3 seconds.

Specified by:
setThroughputCalculationInterval in interface IoSessionConfig

getThroughputCalculationIntervalInMillis

public long getThroughputCalculationIntervalInMillis()
Returns the interval (milliseconds) between each throughput calculation. The default value is 3 seconds.

Specified by:
getThroughputCalculationIntervalInMillis in interface IoSessionConfig


Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.