Class SessionKeepAliveTask

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<org.tentackle.task.Task>, java.lang.Runnable, org.tentackle.task.Task

    public class SessionKeepAliveTask
    extends org.tentackle.task.AbstractTask
    The task to keep a session alive.
    The task uses the ExecutorService to spawn asynchroneous 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:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.concurrent.Callable<java.lang.Boolean> createAliveCallable()
      Creates the alive callable.
      protected java.util.concurrent.Callable<java.lang.Boolean> createCloseCallable()
      Creates the close callable.
      void run()  
      java.lang.String toString()  
      • 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
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • 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
        timeOut - the timeout interval in milliseconds
    • Method Detail

      • run

        public void run()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • createAliveCallable

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

        protected java.util.concurrent.Callable<java.lang.Boolean> createCloseCallable()
        Creates the close callable.
        Returns:
        the callable