Package org.apache.mina.core.session
Class IdleStatusChecker
- java.lang.Object
-
- org.apache.mina.core.session.IdleStatusChecker
-
public class IdleStatusChecker extends java.lang.ObjectDetects idle sessions and firessessionIdleevents to them. To be used for service unable to trigger idle events alone, like VmPipe or SerialTransport. Polling base transport are advised to trigger idle events alone, using the poll/select timeout.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classIdleStatusChecker.NotifyingTaskThe class to place in the transport executor for checking the sessions idleprivate classIdleStatusChecker.SessionCloseListener
-
Field Summary
Fields Modifier and Type Field Description private IdleStatusChecker.NotifyingTasknotifyingTaskprivate IoFutureListener<IoFuture>sessionCloseListenerprivate java.util.Set<AbstractIoSession>sessions
-
Constructor Summary
Constructors Constructor Description IdleStatusChecker()Creates a new instance of IdleStatusChecker
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSession(AbstractIoSession session)Add the session for being checked for idle.IdleStatusChecker.NotifyingTaskgetNotifyingTask()get a runnable task able to be scheduled in theIoServiceexecutor.
-
-
-
Field Detail
-
sessions
private final java.util.Set<AbstractIoSession> sessions
-
notifyingTask
private final IdleStatusChecker.NotifyingTask notifyingTask
-
sessionCloseListener
private final IoFutureListener<IoFuture> sessionCloseListener
-
-
Method Detail
-
addSession
public void addSession(AbstractIoSession session)
Add the session for being checked for idle.- Parameters:
session- the session to check
-
getNotifyingTask
public IdleStatusChecker.NotifyingTask getNotifyingTask()
get a runnable task able to be scheduled in theIoServiceexecutor.- Returns:
- the associated runnable task
-
-