Class PooledSessionTaskDispatcher

  • All Implemented Interfaces:
    org.tentackle.daemon.Terminatable, org.tentackle.task.TaskDispatcher

    public class PooledSessionTaskDispatcher
    extends org.tentackle.task.PooledTaskDispatcher
    Author:
    harald
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.tentackle.task.AbstractPooledTaskDispatcher

        org.tentackle.task.AbstractPooledTaskDispatcher.PooledTaskListener
    • Field Summary

      • Fields inherited from class org.tentackle.task.AbstractPooledTaskDispatcher

        taskListener, taskMap
    • Constructor Summary

      Constructors 
      Constructor Description
      PooledSessionTaskDispatcher​(SessionInfo sessionInfo, int poolSize, java.lang.String name, boolean useMutexLocking, long sleepInterval)
      Creates a non-supervising pooled db task dispatcher.
      PooledSessionTaskDispatcher​(SessionInfo sessionInfo, int poolSize, java.lang.String name, boolean useMutexLocking, long sleepInterval, boolean supervised, long deadInterval)
      Creates a pooled db task dispatcher.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected DefaultSessionTaskDispatcher createDispatcher​(int index)  
      protected Session createSession()
      Creates a new db session.
      protected org.tentackle.daemon.DaemonSupervisor createSupervisor()  
      Session[] getDbSessions()
      Gets the db sessions.
      SessionInfo getSessionInfo()
      Gets the user info.
      • Methods inherited from class org.tentackle.task.PooledTaskDispatcher

        getDeadInterval, getDispatchers, getNextDispatcher, getPoolSize, getShutdownIdleTimeout, getTask, isAlive, isSupervised, isTerminationRequested, lock, requestTermination, setDeadInterval, setShutdownIdleTimeout, start, terminate, toDiagnosticString, unlock
      • Methods inherited from class org.tentackle.task.AbstractPooledTaskDispatcher

        addTask, addTaskAndWait, addTaskListener, createTaskListener, fireCompleted, fireStarted, getAllTasks, getName, getQueueSize, getSleepInterval, isInstanceOfTaskPending, isQueueEmpty, isTaskPending, isUsingMutexLocking, removeTask, removeTaskListener, setName, setSleepInterval, setUsingMutexLocking, waitForTask
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PooledSessionTaskDispatcher

        public PooledSessionTaskDispatcher​(SessionInfo sessionInfo,
                                           int poolSize,
                                           java.lang.String name,
                                           boolean useMutexLocking,
                                           long sleepInterval,
                                           boolean supervised,
                                           long deadInterval)
        Creates a pooled db task dispatcher.
        Parameters:
        sessionInfo - the session info
        poolSize - the fixed pool size
        name - the pool name
        useMutexLocking - true use a mutex for locking, else just a counter
        sleepInterval - keep alive in milliseconds
        supervised - true to use a DaemonSupervisor for each dispatcher
        deadInterval - interval in milliseconds to detect a dead dispatcher, 0 to disable detection (ignored if supervised = false)
      • PooledSessionTaskDispatcher

        public PooledSessionTaskDispatcher​(SessionInfo sessionInfo,
                                           int poolSize,
                                           java.lang.String name,
                                           boolean useMutexLocking,
                                           long sleepInterval)
        Creates a non-supervising pooled db task dispatcher.
        Parameters:
        sessionInfo - the session info
        poolSize - the pool size
        name - the pool name
        useMutexLocking - true use a mutex for locking, else just a counter
        sleepInterval - keep alive in milliseconds
    • Method Detail

      • getDbSessions

        public Session[] getDbSessions()
        Gets the db sessions.
        Returns:
        the db sessions
      • getSessionInfo

        public SessionInfo getSessionInfo()
        Gets the user info.
        Returns:
        the user info
      • createSession

        protected Session createSession()
        Creates a new db session.
        Returns:
        the session
      • createDispatcher

        protected DefaultSessionTaskDispatcher createDispatcher​(int index)
        Overrides:
        createDispatcher in class org.tentackle.task.PooledTaskDispatcher
      • createSupervisor

        protected org.tentackle.daemon.DaemonSupervisor createSupervisor()
        Overrides:
        createSupervisor in class org.tentackle.task.PooledTaskDispatcher