- java.lang.Object
-
- org.tentackle.task.AbstractPooledTaskDispatcher
-
- org.tentackle.task.PooledTaskDispatcher
-
- org.tentackle.session.PooledSessionTaskDispatcher
-
- All Implemented Interfaces:
org.tentackle.daemon.Terminatable,org.tentackle.task.TaskDispatcher
public class PooledSessionTaskDispatcher extends org.tentackle.task.PooledTaskDispatcher- Author:
- harald
-
-
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 DefaultSessionTaskDispatchercreateDispatcher(int index)protected SessioncreateSession()Creates a new db session.protected org.tentackle.daemon.DaemonSupervisorcreateSupervisor()Session[]getDbSessions()Gets the db sessions.SessionInfogetSessionInfo()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
-
-
-
-
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 infopoolSize- the fixed pool sizename- the pool nameuseMutexLocking- true use a mutex for locking, else just a countersleepInterval- keep alive in millisecondssupervised- true to use aDaemonSupervisorfor each dispatcherdeadInterval- 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 infopoolSize- the pool sizename- the pool nameuseMutexLocking- true use a mutex for locking, else just a countersleepInterval- 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:
createDispatcherin classorg.tentackle.task.PooledTaskDispatcher
-
createSupervisor
protected org.tentackle.daemon.DaemonSupervisor createSupervisor()
- Overrides:
createSupervisorin classorg.tentackle.task.PooledTaskDispatcher
-
-