Class SessionKeepAliveTask

java.lang.Object
org.tentackle.task.AbstractTask
org.tentackle.session.SessionKeepAliveTask
All Implemented Interfaces:
Serializable, Comparable<Task>, Runnable, Task

public class SessionKeepAliveTask extends AbstractTask
The task to keep a session alive.
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 Details

    • SessionKeepAliveTask

      public SessionKeepAliveTask(SessionKeepAliveDaemon daemon, Session session, long interval, long timeOut)
      Creates a keep alive task.
      Parameters:
      daemon - the keep alive daemon
      session - the session
      interval - the check interval in milliseconds, ≤ 0 to close the session
      timeOut - the timeout interval in milliseconds
  • Method Details

    • run

      public void run()
    • toString

      public String toString()
      Overrides:
      toString in class AbstractTask
    • createAliveCallable

      protected Callable<Boolean> createAliveCallable()
      Creates the alive callable.
      Returns:
      the callable
    • createCloseCallable

      protected Callable<Boolean> createCloseCallable()
      Creates the close callable.
      Returns:
      the callable