public class IoServiceIdleState
extends java.lang.Object
AbstractIoService
.Constructor and Description |
---|
IoServiceIdleState(AbstractIoService service) |
Modifier and Type | Method and Description |
---|---|
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. |
public IoServiceIdleState(AbstractIoService service)
public final boolean isIdle(IdleStatus status)
true
if this service is idle for the specified
IdleStatus
.public final boolean isReaderIdle()
true
if this service is IdleStatus.READER_IDLE
.isIdle(IdleStatus)
public final boolean isWriterIdle()
true
if this service is IdleStatus.WRITER_IDLE
.isIdle(IdleStatus)
public final boolean isBothIdle()
true
if this service is IdleStatus.BOTH_IDLE
.isIdle(IdleStatus)
public final int getIdleCount(IdleStatus status)
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.public final int getReaderIdleCount()
IdleStatus.READER_IDLE
.getIdleCount(IdleStatus)
public final int getWriterIdleCount()
IdleStatus.WRITER_IDLE
.getIdleCount(IdleStatus)
public final int getBothIdleCount()
IdleStatus.BOTH_IDLE
.getIdleCount(IdleStatus)
public final long getLastIdleTime(IdleStatus status)
IdleStatus
.public final long getLastReaderIdleTime()
IdleStatus.READER_IDLE
.getLastIdleTime(IdleStatus)
public final long getLastWriterIdleTime()
IdleStatus.WRITER_IDLE
.getLastIdleTime(IdleStatus)
public final long getLastBothIdleTime()
IdleStatus.BOTH_IDLE
.getLastIdleTime(IdleStatus)
public final int getIdleTime(IdleStatus status)
public final long getIdleTimeInMillis(IdleStatus status)
public final void setIdleTime(IdleStatus status, int idleTime)
public final int getReaderIdleTime()
IdleStatus.READER_IDLE
in seconds.public final long getReaderIdleTimeInMillis()
IdleStatus.READER_IDLE
in milliseconds.public final void setReaderIdleTime(int idleTime)
IdleStatus.READER_IDLE
in seconds.public final int getWriterIdleTime()
IdleStatus.WRITER_IDLE
in seconds.public final long getWriterIdleTimeInMillis()
IdleStatus.WRITER_IDLE
in milliseconds.public final void setWriterIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.public final int getBothIdleTime()
IdleStatus.BOTH_IDLE
in seconds.public final long getBothIdleTimeInMillis()
IdleStatus.BOTH_IDLE
in milliseconds.public final void setBothIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.public final void notifyIdleness(long currentTime)
protected void resetIdleCountForRead()
protected void resetIdleCountForWrite()
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.