Interface SessionTaskDispatcher

  • All Superinterfaces:
    org.tentackle.task.TaskDispatcher, org.tentackle.daemon.Terminatable
    All Known Subinterfaces:
    ModificationTracker
    All Known Implementing Classes:
    DefaultSessionTaskDispatcher

    public interface SessionTaskDispatcher
    extends org.tentackle.task.TaskDispatcher
    A TaskDispatcher using a Session.
    Author:
    harald
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Session getSession()
      Gets the session.
      boolean isSessionClosedOnTermination()
      Returns whether the session should be closed on termination.
      boolean isSessionKeptAlive()
      Gets the keepalive flag.
      void setSession​(Session session)
      Sets the session.
      void setSessionClosedOnTermination​(boolean sessionClosedOnTermination)
      Sets whether the session should be closed on termination.
      void setSessionKeptAlive​(boolean sessionKeptAlive)
      Sets the keepalive flag.
      If set, setAlive() will be invoked periodically to keep the session alive.
      • Methods inherited from interface org.tentackle.task.TaskDispatcher

        addTask, addTaskAndWait, addTaskListener, getAllTasks, getDeadInterval, getQueueSize, getShutdownIdleTimeout, getSleepInterval, getTask, isAlive, isInstanceOfTaskPending, isQueueEmpty, isTaskPending, isUsingMutexLocking, lock, removeTask, removeTaskListener, setDeadInterval, setShutdownIdleTimeout, setSleepInterval, setUsingMutexLocking, start, toDiagnosticString, unlock, waitForTask
      • Methods inherited from interface org.tentackle.daemon.Terminatable

        isTerminationRequested, requestTermination, terminate
    • Method Detail

      • getSession

        Session getSession()
        Gets the session.
        Returns:
        the session
      • setSession

        void setSession​(Session session)
        Sets the session.
        Parameters:
        session - the session
        Throws:
        org.tentackle.task.TaskException - if dispatcher is already running or not invoked from the dispatcher thread
      • setSessionKeptAlive

        void setSessionKeptAlive​(boolean sessionKeptAlive)
        Sets the keepalive flag.
        If set, setAlive() will be invoked periodically to keep the session alive.
        Parameters:
        sessionKeptAlive - true if ping enabled
      • isSessionKeptAlive

        boolean isSessionKeptAlive()
        Gets the keepalive flag.
        Returns:
        true if ping enabled
      • isSessionClosedOnTermination

        boolean isSessionClosedOnTermination()
        Returns whether the session should be closed on termination.
        Returns:
        true if should be closed, false if remains open
      • setSessionClosedOnTermination

        void setSessionClosedOnTermination​(boolean sessionClosedOnTermination)
        Sets whether the session should be closed on termination.
        Parameters:
        sessionClosedOnTermination - true if should be closed, false if remains open