public class IndexedIdleChecker extends Object implements IdleChecker
+--- Current time | v +---+---+...+---+---+...+---+ | 0 | 1 | | T |T+1| |599| +---+---+...+---+---+...+---+ | | | +--> { S2, S7, S12...} (sessions that will TO in one second) +------> { S5, S6, S8...} (sessions that are idle for the maximum delay of 1 hour )The maximum idle itme is one hour.
Constructor and Description |
---|
IndexedIdleChecker() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Stop the idle checker.
|
int |
processIdleSession(long timeMs)
Find idle session, to be called for each select() call.
|
void |
sessionRead(AbstractIoSession session,
long timeInMs)
Inform the IdleCheker a session have a read event
|
void |
sessionWritten(AbstractIoSession session,
long timeInMs)
Inform the IdleCheker a session have a write event
|
void |
start()
Start the idle checker inner threads
|
public void start()
start
in interface IdleChecker
public void destroy()
destroy
in interface IdleChecker
public void sessionRead(AbstractIoSession session, long timeInMs)
sessionRead
in interface IdleChecker
session
- the session with the read eventtimeInMs
- the data in ms (unix time) of the eventpublic void sessionWritten(AbstractIoSession session, long timeInMs)
sessionWritten
in interface IdleChecker
session
- the session with the write eventtimeInMs
- the data in ms (unix time) of the eventpublic int processIdleSession(long timeMs)
processIdleSession
in interface IdleChecker
timeMs
- current unix time in msCopyright © 2009–2013 Apache MINA Project. All rights reserved.