net.gleamynode.netty2
Class SessionConfig

java.lang.Object
  extended bynet.gleamynode.netty2.SessionConfig
All Implemented Interfaces:
SessionConfigMBean

public class SessionConfig
extends Object
implements SessionConfigMBean

Contains properties for Sessions. You can create one config object and apply it calling Session.setConfig(SessionConfig)method.

Version:
$Rev: 4 $, $Date: 2005-04-18 12:04:09 +0900 $
Author:
Trustin Lee (http://gleamynode.net/)
See Also:
Session

Constructor Summary
SessionConfig()
          Creates a new instance with default settings.
 
Method Summary
 ByteOrder getByteOrder()
          Returns the ByteOrderof ByteBuffers that are passed to Messages.
 int getConnectTimeout()
          Returns connect timeout in seconds.
 int getConnectTimeoutInMillis()
          Returns connect timeout in milliseconds.
 int getIdleTime()
          Returns the idle time of this session in seconds.
 int getIdleTimeInMillis()
          Returns the idle time of this session in milliseconds.
 int getMaxQueuedWriteCount()
          Returns the maximum number of remaining write requests which were queued by Session.write(Message).
 int getWriteTimeout()
          Returns write timeout in seconds.
 int getWriteTimeoutInMillis()
          Returns write timeout in milliseconds.
 void setByteOrder(ByteOrder byteOrder)
          Sets the ByteOrderof ByteBuffers that are passed to Messages.
 void setConnectTimeout(int connectTimeout)
          Sets connect timeout in seconds.
 void setIdleTime(int idleTime)
          Sets the idle time of this session in seconds.
 void setMaxQueuedWriteCount(int newLimit)
          Sets the maximum number of remaining write requests which were queued by Session.write(Message).
 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

SessionConfig

public SessionConfig()
Creates a new instance with default settings.

Method Detail

getConnectTimeout

public int getConnectTimeout()
Returns connect timeout in seconds.

Specified by:
getConnectTimeout in interface SessionConfigMBean

getConnectTimeoutInMillis

public int getConnectTimeoutInMillis()
Returns connect timeout in milliseconds.


setConnectTimeout

public void setConnectTimeout(int connectTimeout)
Sets connect timeout in seconds. Connection attempt will automatically fail and ConnectExceptionwill be thrown if the specified time passes. Default value is 0 (disabled).

Specified by:
setConnectTimeout in interface SessionConfigMBean
Throws:
IllegalArgumentException - if the specified timeout is too big or less than 0.

getIdleTime

public int getIdleTime()
Returns the idle time of this session in seconds.

Specified by:
getIdleTime in interface SessionConfigMBean

getIdleTimeInMillis

public int getIdleTimeInMillis()
Returns the idle time of this session in milliseconds.


setIdleTime

public void setIdleTime(int idleTime)
Sets the idle time of this session in seconds. If there was no I/O for idleTime seconds, it will generate sessionIdle event. Specify 0 to disable.

Specified by:
setIdleTime in interface SessionConfigMBean
Throws:
IllegalArgumentException - if the specified time is too big or less tnan 0

getMaxQueuedWriteCount

public int getMaxQueuedWriteCount()
Returns the maximum number of remaining write requests which were queued by Session.write(Message). If the number of remaining write requests exceeds this value, Session.write(Message)method will block. The default value is 0 (disabled).

Specified by:
getMaxQueuedWriteCount in interface SessionConfigMBean

setMaxQueuedWriteCount

public void setMaxQueuedWriteCount(int newLimit)
Sets the maximum number of remaining write requests which were queued by Session.write(Message). If the number of remaining write requests exceeds this value, Session.write(Message)method will block. The default value is 0 (disabled).

Specified by:
setMaxQueuedWriteCount in interface SessionConfigMBean

getWriteTimeout

public int getWriteTimeout()
Returns write timeout in seconds. I/O thread will throw a SocketTimeoutExceptionif it takes too long to flush the write buffer. This is useful dropping too slow clients. Default value is 0 (disabled).

Specified by:
getWriteTimeout in interface SessionConfigMBean
Returns:
the write timeout, 0 if disabled.

getWriteTimeoutInMillis

public int getWriteTimeoutInMillis()
Returns write timeout in milliseconds. I/O thread will throw a SocketTimeoutExceptionif it takes too long to flush the write buffer. This is useful dropping too slow clients. Default value is 0 (disabled).

Returns:
the write timeout, 0 if disabled.

setWriteTimeout

public void setWriteTimeout(int writeTimeout)
Sets write timeout in seconds. I/O thread will throw a SocketTimeoutExceptionif it takes too long to flush the write buffer. This is useful dropping too slow clients. Default value is 0 (disabled).

Specified by:
setWriteTimeout in interface SessionConfigMBean
Throws:
IllegalArgumentException - if the specified value is less than 0.

getByteOrder

public ByteOrder getByteOrder()
Returns the ByteOrderof ByteBuffers that are passed to Messages. The default value is ByteOrder.BIG_ENDIAN.


setByteOrder

public void setByteOrder(ByteOrder byteOrder)
Sets the ByteOrderof ByteBuffers that are passed to Messages. Changing the order does not affect currently communicating sessions. The default value is ByteOrder.BIG_ENDIAN.



Copyright © 2004-2007 Trustin Lee. All Rights Reserved.