Class AbstractSessionTask
java.lang.Object
org.tentackle.task.AbstractTask
org.tentackle.session.AbstractSessionTask
- All Implemented Interfaces:
Serializable, Comparable<Task>, Runnable, SessionDependable, SessionProvider, Task
A task being executed by a
The dispatcher applies its session when the task is added.
SessionTaskDispatcher.The dispatcher applies its session when the task is added.
- Author:
- harald
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the session the task must use.booleanReturns whether the session is immutable.voidsetSession(Session session) Sets the session.
Done by theDefaultSessionTaskDispatcherwhen the task is added.voidsetSessionImmutable(boolean sessionImmutable) Sets the session to immutable.Methods inherited from class AbstractTask
addTaskListener, compareTo, equals, fireCompleted, fireStarted, getCause, getCompleted, getDispatcher, getId, getRepeatInterval, getResult, getScheduledEpochalTime, getStarted, hashCode, isInterruptable, removeTaskListener, setCause, setCompleted, setDispatcher, setId, setRepeatInterval, setResult, setScheduledEpochalTime, setStarted, toString
-
Constructor Details
-
AbstractSessionTask
public AbstractSessionTask()Parent constructor.
-
-
Method Details
-
setSession
Sets the session.
Done by theDefaultSessionTaskDispatcherwhen the task is added.- Specified by:
setSessionin interfaceSessionDependable- Parameters:
session- the session- Throws:
PersistenceException- if the session is immutable and the new session differs
-
getSession
Gets the session the task must use.- Specified by:
getSessionin interfaceSessionProvider- Returns:
- the session
-
setSessionImmutable
public void setSessionImmutable(boolean sessionImmutable) Description copied from interface:SessionDependableSets the session to immutable.- Specified by:
setSessionImmutablein interfaceSessionDependable- Parameters:
sessionImmutable- true if the session cannot be changed anymore
-
isSessionImmutable
public boolean isSessionImmutable()Description copied from interface:SessionDependableReturns whether the session is immutable.- Specified by:
isSessionImmutablein interfaceSessionDependable- Returns:
- true if immutable
-