-
- 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.TaskDispatcherA TaskDispatcher using a Session.- Author:
- harald
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SessiongetSession()Gets the session.booleanisSessionClosedOnTermination()Returns whether the session should be closed on termination.booleanisSessionKeptAlive()Gets 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, isAlive, isInstanceOfTaskPending, isQueueEmpty, isTaskPending, isUsingMutexLocking, lock, removeTask, removeTaskListener, setDeadInterval, setShutdownIdleTimeout, setSleepInterval, setUsingMutexLocking, start, toDiagnosticString, unlock, waitForTask
-
-
-
-
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
-
-