|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IoService
Base interface for all IoAcceptor
s and IoConnector
s
that provide I/O service and manage IoSession
s.
Method Summary | |
---|---|
void |
addListener(IoServiceListener listener)
Adds an IoServiceListener that listens any events related with
this service. |
Set<WriteFuture> |
broadcast(Object message)
Writes the specified message to all the IoSession s
managed by this service. |
void |
dispose()
Releases any resources allocated by this service. |
long |
getActivationTime()
Returns the time when this service was activated. |
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. |
long |
getCumulativeManagedSessionCount()
Returns the cumulative number of sessions which were managed (or are being managed) by this service, which means 'currently managed session count + closed session count'. |
DefaultIoFilterChainBuilder |
getFilterChain()
A shortcut for ( ( DefaultIoFilterChainBuilder ) getFilterChainBuilder() ). |
IoFilterChainBuilder |
getFilterChainBuilder()
Returns the IoFilterChainBuilder which will build the
IoFilterChain of all IoSession s which is created
by this service. |
IoHandler |
getHandler()
Returns the handler which will handle all connections managed by this service. |
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. |
int |
getLargestManagedSessionCount()
Returns the maximum number of sessions which were being managed at the same time. |
double |
getLargestReadBytesThroughput()
Returns the maximum of the readBytesThroughput . |
double |
getLargestReadMessagesThroughput()
Returns the maximum of the readMessagesThroughput . |
double |
getLargestWrittenBytesThroughput()
Returns the maximum of the writtenBytesThroughput . |
double |
getLargestWrittenMessagesThroughput()
Returns the maximum of the writtenMessagesThroughput . |
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 |
getLastIoTime()
Returns the time in millis when I/O occurred lastly. |
long |
getLastReaderIdleTime()
Returns the time in milliseconds when the last serviceIdle event is fired for IdleStatus.READER_IDLE . |
long |
getLastReadTime()
Returns the time in millis when read operation occurred lastly. |
long |
getLastWriterIdleTime()
Returns the time in milliseconds when the last serviceIdle event is fired for IdleStatus.WRITER_IDLE . |
long |
getLastWriteTime()
Returns the time in millis when write operation occurred lastly. |
int |
getManagedSessionCount()
Returns the number of all sessions which are currently managed by this service. |
Set<IoSession> |
getManagedSessions()
Returns all sessions which are currently managed by this service. |
long |
getReadBytes()
Returns the number of bytes read by this service |
double |
getReadBytesThroughput()
Returns the number of read bytes per second. |
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. |
long |
getReadMessages()
Returns the number of messages this services has read |
double |
getReadMessagesThroughput()
Returns the number of read messages per second. |
long |
getScheduledWriteBytes()
Returns the number of bytes scheduled to be written |
long |
getScheduledWriteMessages()
Returns the number of messages scheduled to be written |
IoSessionConfig |
getSessionConfig()
Returns the default configuration of the new IoSession s
created by this service. |
IoSessionDataStructureFactory |
getSessionDataStructureFactory()
Returns the IoSessionDataStructureFactory that provides
related data structures for a new session created by this service. |
int |
getThroughputCalculationInterval()
Returns the interval (seconds) between each throughput calculation. |
long |
getThroughputCalculationIntervalInMillis()
Returns the interval (milliseconds) between each throughput calculation. |
TransportMetadata |
getTransportMetadata()
Returns the TransportMetadata that this service runs on. |
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. |
long |
getWrittenBytes()
Returns the number of bytes written out by this service |
double |
getWrittenBytesThroughput()
Returns the number of written bytes per second. |
long |
getWrittenMessages()
Returns the number of messages this service has written |
double |
getWrittenMessagesThroughput()
Returns the number of written messages per second. |
boolean |
isActive()
Returns a value of whether or not this service is active |
boolean |
isBothIdle()
Returns true if this service is IdleStatus.BOTH_IDLE . |
boolean |
isDisposed()
Returns true if and if only all resources of this processor have been disposed. |
boolean |
isDisposing()
Returns true if and if only dispose() method has
been called. |
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 |
removeListener(IoServiceListener listener)
Removed an existing IoServiceListener that listens any events
related with this service. |
void |
setBothIdleTime(int idleTime)
Sets idle time for IdleStatus.WRITER_IDLE in seconds. |
void |
setFilterChainBuilder(IoFilterChainBuilder builder)
Sets the IoFilterChainBuilder which will build the
IoFilterChain of all IoSession s which is created
by this service. |
void |
setHandler(IoHandler handler)
Sets the handler which will handle all connections managed by this service. |
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 |
setSessionDataStructureFactory(IoSessionDataStructureFactory sessionDataStructureFactory)
Sets the IoSessionDataStructureFactory that provides
related data structures for a new session created by this service. |
void |
setThroughputCalculationInterval(int throughputCalculationInterval)
Sets the interval (seconds) between each throughput calculation. |
void |
setWriterIdleTime(int idleTime)
Sets idle time for IdleStatus.WRITER_IDLE in seconds. |
Method Detail |
---|
TransportMetadata getTransportMetadata()
TransportMetadata
that this service runs on.
void addListener(IoServiceListener listener)
IoServiceListener
that listens any events related with
this service.
void removeListener(IoServiceListener listener)
IoServiceListener
that listens any events
related with this service.
boolean isDisposing()
dispose()
method has
been called. Please note that this method will return true
even after all the related resources are released.
boolean isDisposed()
void dispose()
IoHandler getHandler()
void setHandler(IoHandler handler)
Set<IoSession> getManagedSessions()
int getManagedSessionCount()
int getLargestManagedSessionCount()
long getCumulativeManagedSessionCount()
IoSessionConfig getSessionConfig()
IoSession
s
created by this service.
IoFilterChainBuilder getFilterChainBuilder()
IoFilterChainBuilder
which will build the
IoFilterChain
of all IoSession
s which is created
by this service.
The default value is an empty DefaultIoFilterChainBuilder
.
void setFilterChainBuilder(IoFilterChainBuilder builder)
IoFilterChainBuilder
which will build the
IoFilterChain
of all IoSession
s which is created
by this service.
If you specify null this property will be set to
an empty DefaultIoFilterChainBuilder
.
DefaultIoFilterChainBuilder getFilterChain()
getFilterChainBuilder()
).
Please note that the returned object is not a real IoFilterChain
but a DefaultIoFilterChainBuilder
. Modifying the returned builder
won't affect the existing IoSession
s at all, because
IoFilterChainBuilder
s affect only newly created IoSession
s.
IllegalStateException
- if the current IoFilterChainBuilder
is
not a DefaultIoFilterChainBuilder
boolean isActive()
long getActivationTime()
System.currentTimeMillis()
long getLastIoTime()
long getLastReadTime()
long getLastWriteTime()
boolean isIdle(IdleStatus status)
true
if this service is idle for the specified
IdleStatus
.
boolean isReaderIdle()
true
if this service is IdleStatus.READER_IDLE
.
isIdle(IdleStatus)
boolean isWriterIdle()
true
if this service is IdleStatus.WRITER_IDLE
.
isIdle(IdleStatus)
boolean isBothIdle()
true
if this service is IdleStatus.BOTH_IDLE
.
isIdle(IdleStatus)
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.
int getReaderIdleCount()
IdleStatus.READER_IDLE
.
getIdleCount(IdleStatus)
int getWriterIdleCount()
IdleStatus.WRITER_IDLE
.
getIdleCount(IdleStatus)
int getBothIdleCount()
IdleStatus.BOTH_IDLE
.
getIdleCount(IdleStatus)
long getLastIdleTime(IdleStatus status)
IdleStatus
.
long getLastReaderIdleTime()
IdleStatus.READER_IDLE
.
getLastIdleTime(IdleStatus)
long getLastWriterIdleTime()
IdleStatus.WRITER_IDLE
.
getLastIdleTime(IdleStatus)
long getLastBothIdleTime()
IdleStatus.BOTH_IDLE
.
getLastIdleTime(IdleStatus)
int getIdleTime(IdleStatus status)
long getIdleTimeInMillis(IdleStatus status)
void setIdleTime(IdleStatus status, int idleTime)
int getReaderIdleTime()
IdleStatus.READER_IDLE
in seconds.
long getReaderIdleTimeInMillis()
IdleStatus.READER_IDLE
in milliseconds.
void setReaderIdleTime(int idleTime)
IdleStatus.READER_IDLE
in seconds.
int getWriterIdleTime()
IdleStatus.WRITER_IDLE
in seconds.
long getWriterIdleTimeInMillis()
IdleStatus.WRITER_IDLE
in milliseconds.
void setWriterIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.
int getBothIdleTime()
IdleStatus.BOTH_IDLE
in seconds.
long getBothIdleTimeInMillis()
IdleStatus.BOTH_IDLE
in milliseconds.
void setBothIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.
long getReadBytes()
long getWrittenBytes()
long getReadMessages()
long getWrittenMessages()
double getReadBytesThroughput()
double getWrittenBytesThroughput()
double getReadMessagesThroughput()
double getWrittenMessagesThroughput()
double getLargestReadBytesThroughput()
readBytesThroughput
.
double getLargestWrittenBytesThroughput()
writtenBytesThroughput
.
double getLargestReadMessagesThroughput()
readMessagesThroughput
.
double getLargestWrittenMessagesThroughput()
writtenMessagesThroughput
.
int getThroughputCalculationInterval()
long getThroughputCalculationIntervalInMillis()
void setThroughputCalculationInterval(int throughputCalculationInterval)
long getScheduledWriteBytes()
long getScheduledWriteMessages()
Set<WriteFuture> broadcast(Object message)
message
to all the IoSession
s
managed by this service. This method is a convenience shortcut for
IoUtil.broadcast(Object, Collection)
.
IoSessionDataStructureFactory getSessionDataStructureFactory()
IoSessionDataStructureFactory
that provides
related data structures for a new session created by this service.
void setSessionDataStructureFactory(IoSessionDataStructureFactory sessionDataStructureFactory)
IoSessionDataStructureFactory
that provides
related data structures for a new session created by this service.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |