org.apache.mina.core.service
Class IoServiceIdleState

java.lang.Object
  extended by org.apache.mina.core.service.IoServiceIdleState

public class IoServiceIdleState
extends Object

Provides the idle state information associated with an AbstractIoService.

Since:
2.0.0-M3
Version:
$Rev$, $Date$
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
IoServiceIdleState(AbstractIoService service)
           
 
Method Summary
 int getBothIdleCount()
          Returns the number of the fired continuous serviceIdle events for IdleStatus.BOTH_IDLE.
 int getBothIdleTime()
          Returns idle time for IdleStatus.BOTH_IDLE in seconds.
 long getBothIdleTimeInMillis()
          Returns idle time for IdleStatus.BOTH_IDLE in milliseconds.
 int getIdleCount(IdleStatus status)
          Returns the number of the fired continuous serviceIdle events for the specified IdleStatus.
 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.
 long getLastBothIdleTime()
          Returns the time in milliseconds when the last serviceIdle event is fired for IdleStatus.BOTH_IDLE.
 long getLastIdleTime(IdleStatus status)
          Returns the time in milliseconds when the last serviceIdle event is fired for the specified IdleStatus.
 long getLastReaderIdleTime()
          Returns the time in milliseconds when the last serviceIdle event is fired for IdleStatus.READER_IDLE.
 long getLastWriterIdleTime()
          Returns the time in milliseconds when the last serviceIdle event is fired for IdleStatus.WRITER_IDLE.
 int getReaderIdleCount()
          Returns the number of the fired continuous serviceIdle events for IdleStatus.READER_IDLE.
 int getReaderIdleTime()
          Returns idle time for IdleStatus.READER_IDLE in seconds.
 long getReaderIdleTimeInMillis()
          Returns idle time for IdleStatus.READER_IDLE in milliseconds.
 int getWriterIdleCount()
          Returns the number of the fired continuous serviceIdle events for IdleStatus.WRITER_IDLE.
 int getWriterIdleTime()
          Returns idle time for IdleStatus.WRITER_IDLE in seconds.
 long getWriterIdleTimeInMillis()
          Returns idle time for IdleStatus.WRITER_IDLE in milliseconds.
 boolean isBothIdle()
          Returns true if this service is IdleStatus.BOTH_IDLE.
 boolean isIdle(IdleStatus status)
          Returns true if this service is idle for the specified IdleStatus.
 boolean isReaderIdle()
          Returns true if this service is IdleStatus.READER_IDLE.
 boolean isWriterIdle()
          Returns true if this service is IdleStatus.WRITER_IDLE.
 void notifyIdleness(long currentTime)
          TODO add documentation
protected  void resetIdleCountForRead()
          TODO add documentation
protected  void resetIdleCountForWrite()
          TODO add documentation
 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 setReaderIdleTime(int idleTime)
          Sets idle time for IdleStatus.READER_IDLE in seconds.
 void setWriterIdleTime(int idleTime)
          Sets idle time for IdleStatus.WRITER_IDLE in seconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IoServiceIdleState

public IoServiceIdleState(AbstractIoService service)
Method Detail

isIdle

public final boolean isIdle(IdleStatus status)
Returns true if this service is idle for the specified IdleStatus.


isReaderIdle

public final boolean isReaderIdle()
Returns true if this service is IdleStatus.READER_IDLE.

See Also:
isIdle(IdleStatus)

isWriterIdle

public final boolean isWriterIdle()
Returns true if this service is IdleStatus.WRITER_IDLE.

See Also:
isIdle(IdleStatus)

isBothIdle

public final boolean isBothIdle()
Returns true if this service is IdleStatus.BOTH_IDLE.

See Also:
isIdle(IdleStatus)

getIdleCount

public final int getIdleCount(IdleStatus status)
Returns the number of the fired continuous serviceIdle events for the specified IdleStatus.

If serviceIdle event is fired first after some time after I/O, idleCount becomes 1. idleCount resets to 0 if any I/O occurs again, otherwise it increases to 2 and so on if serviceIdle event is fired again without any I/O between two (or more) serviceIdle events.


getReaderIdleCount

public final int getReaderIdleCount()
Returns the number of the fired continuous serviceIdle events for IdleStatus.READER_IDLE.

See Also:
getIdleCount(IdleStatus)

getWriterIdleCount

public final int getWriterIdleCount()
Returns the number of the fired continuous serviceIdle events for IdleStatus.WRITER_IDLE.

See Also:
getIdleCount(IdleStatus)

getBothIdleCount

public final int getBothIdleCount()
Returns the number of the fired continuous serviceIdle events for IdleStatus.BOTH_IDLE.

See Also:
getIdleCount(IdleStatus)

getLastIdleTime

public final long getLastIdleTime(IdleStatus status)
Returns the time in milliseconds when the last serviceIdle event is fired for the specified IdleStatus.


getLastReaderIdleTime

public final long getLastReaderIdleTime()
Returns the time in milliseconds when the last serviceIdle event is fired for IdleStatus.READER_IDLE.

See Also:
getLastIdleTime(IdleStatus)

getLastWriterIdleTime

public final long getLastWriterIdleTime()
Returns the time in milliseconds when the last serviceIdle event is fired for IdleStatus.WRITER_IDLE.

See Also:
getLastIdleTime(IdleStatus)

getLastBothIdleTime

public final long getLastBothIdleTime()
Returns the time in milliseconds when the last serviceIdle event is fired for IdleStatus.BOTH_IDLE.

See Also:
getLastIdleTime(IdleStatus)

getIdleTime

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


getIdleTimeInMillis

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


setIdleTime

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


getReaderIdleTime

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


getReaderIdleTimeInMillis

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


setReaderIdleTime

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


getWriterIdleTime

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


getWriterIdleTimeInMillis

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


setWriterIdleTime

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


getBothIdleTime

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


getBothIdleTimeInMillis

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


setBothIdleTime

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


notifyIdleness

public final void notifyIdleness(long currentTime)
TODO add documentation


resetIdleCountForRead

protected void resetIdleCountForRead()
TODO add documentation


resetIdleCountForWrite

protected void resetIdleCountForWrite()
TODO add documentation



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