- All Superinterfaces:
TaskDispatcher,Terminatable
- All Known Subinterfaces:
ModificationTracker
- All Known Implementing Classes:
DefaultSessionTaskDispatcher
A TaskDispatcher using a Session.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescriptionGets the session.booleanReturns whether the session should be closed on termination.booleanGets the keepalive flag.voidsetSession(Session session) Sets the session.voidsetSessionClosedOnTermination(boolean sessionClosedOnTermination) Sets whether the session should be closed on termination.voidsetSessionKeptAlive(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, getWaitInterval, isAlive, isInstanceOfTaskPending, isQueueEmpty, isTaskPending, isUsingMutexLocking, lock, removeTask, removeTaskListener, setDeadInterval, setShutdownIdleTimeout, setSleepInterval, setUsingMutexLocking, setWaitInterval, start, toDiagnosticString, unlock, waitForTaskMethods inherited from interface org.tentackle.daemon.Terminatable
isTerminationRequested, requestTermination, terminate
-
Method Details
-
getSession
Session getSession()Gets the session.- Returns:
- the session
-
setSession
Sets the session.- Parameters:
session- the session- Throws:
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 to close, false to leave it open
-
setSessionClosedOnTermination
void setSessionClosedOnTermination(boolean sessionClosedOnTermination) Sets whether the session should be closed on termination.- Parameters:
sessionClosedOnTermination- true to close, false to leave it open
-