- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ThreadLocalSessionHolder
Holder for a session.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescriptionGets the session.
The thread-local session is returned if the session is null.Gets the session info associated to the session.intGets the unique instance number of the Session.booleanReturns whether the session is immutable.booleanReturns whether the session is thread-local.voidsetSession(Session session) Sets the session.voidsetSessionImmutable(boolean sessionImmutable) Sets the session to immutable.
-
Method Details
-
getSession
Session getSession()Gets the session.
The thread-local session is returned if the session is null.- Returns:
- the session.
-
setSession
Sets the session.- Parameters:
session- the session, null if thread-local
-
isSessionThreadLocal
boolean isSessionThreadLocal()Returns whether the session is thread-local.- Returns:
- true if thread-local
-
setSessionImmutable
void setSessionImmutable(boolean sessionImmutable) Sets the session to immutable.- Parameters:
sessionImmutable- true if session cannot be changed anymore
-
isSessionImmutable
boolean isSessionImmutable()Returns whether the session is immutable.- Returns:
- true if immutable
-
getSessionInfo
SessionInfo getSessionInfo()Gets the session info associated to the session.- Returns:
- the session info
-
getSessionInstanceNumber
int getSessionInstanceNumber()Gets the unique instance number of the Session.Delegating
getSession().getInstanceNumber()togetSessionInstanceNumberallows to override getSession and dynamically retrieve the thread's session without changing the sorting order.- Returns:
- the session's instance number
-