Class SessionKeepAliveDaemon

java.lang.Object
java.lang.Thread
org.tentackle.task.DefaultTaskDispatcher
org.tentackle.session.SessionKeepAliveDaemon
All Implemented Interfaces:
Runnable, Killable, Supervisable, Terminatable, TaskDispatcher

public class SessionKeepAliveDaemon extends DefaultTaskDispatcher
A task dispatcher to keep sessions alive.
Author:
harald
  • Constructor Details

    • SessionKeepAliveDaemon

      public SessionKeepAliveDaemon(long minAliveInterval)
      Creates the daemon.
      Parameters:
      minAliveInterval - the minimum alive interval
  • Method Details

    • cleanup

      protected void cleanup()
      Description copied from class: DefaultTaskDispatcher
      Does any necessary cleanup after dispatcher thread has been terminated.
      Overrides:
      cleanup in class DefaultTaskDispatcher
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class DefaultTaskDispatcher
    • keepAliveIntervalChanged

      public void keepAliveIntervalChanged(Session session)
      Handles the change of a keep alive interval of a session.
      Parameters:
      session - the session
    • removeAliveTask

      public void removeAliveTask(Session session)
      Removes the task for given session.
      Parameters:
      session - the session
    • getExecutorService

      public ExecutorService getExecutorService()
      Gets the executor service.
      Returns:
      the executor service
    • createExecutorService

      protected ExecutorService createExecutorService()
      Creates the executor service.
      Returns:
      the executor service
    • createAliveTask

      protected Task createAliveTask(Session session, long interval)
      Creates a keep alive task.
      Parameters:
      session - the session
      interval - the keep-alive interval in milliseconds
      Returns:
      the created task