java.lang.Object
org.tentackle.task.AbstractTask
org.tentackle.session.SessionKeepAliveTask
- All Implemented Interfaces:
Serializable,Comparable<Task>,Runnable,Task
The task to keep a session alive.
The task uses the
The task uses the
ExecutorService to spawn asynchronous pings.
This is necessary because a remote session
may block on slow or bad communication lines which should not block the whole task dispatcher.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSessionKeepAliveTask(SessionKeepAliveDaemon daemon, Session session, long interval, long timeOut) Creates a keep alive task. -
Method Summary
Methods inherited from class org.tentackle.task.AbstractTask
addTaskListener, compareTo, equals, fireCompleted, fireStarted, getCause, getCompleted, getDispatcher, getId, getRepeatInterval, getResult, getScheduledEpochalTime, getStarted, hashCode, isInterruptable, removeTaskListener, setCause, setCompleted, setDispatcher, setId, setRepeatInterval, setResult, setScheduledEpochalTime, setStarted
-
Constructor Details
-
SessionKeepAliveTask
public SessionKeepAliveTask(SessionKeepAliveDaemon daemon, Session session, long interval, long timeOut) Creates a keep alive task.- Parameters:
daemon- the keep alive daemonsession- the sessioninterval- the check interval in milliseconds, ≤ 0 to close the sessiontimeOut- the timeout interval in milliseconds
-
-
Method Details
-
run
public void run() -
toString
- Overrides:
toStringin classAbstractTask
-
createAliveCallable
Creates the alive callable.- Returns:
- the callable
-
createCloseCallable
Creates the close callable.- Returns:
- the callable
-