public class ThreadLocalSessionHolder extends Object implements SessionHolder
| Constructor and Description |
|---|
ThreadLocalSessionHolder() |
| Modifier and Type | Method and Description |
|---|---|
Session |
getSession()
Gets the session.
The threadlocal session is returned if the session is null. |
SessionInfo |
getSessionInfo()
The SessionInfo extends the UserInfo by a SecurityManager.
|
int |
getSessionInstanceNumber()
Gets the unique instance number of the Session.
|
boolean |
isSessionImmutable()
Returns whether the session is immutable.
|
boolean |
isSessionThreadLocal()
Returns whether the session is thread local.
|
void |
setSession(Session session)
Sets the session.
|
void |
setSessionImmutable(boolean sessionImmutable)
Sets the session to immutable.
|
public Session getSession()
SessionHoldergetSession in interface SessionHolderpublic void setSession(Session session)
SessionHoldersetSession in interface SessionHoldersession - the session, null if threadlocalpublic boolean isSessionThreadLocal()
SessionHolderisSessionThreadLocal in interface SessionHolderpublic void setSessionImmutable(boolean sessionImmutable)
SessionHoldersetSessionImmutable in interface SessionHoldersessionImmutable - true if session cannot be changed anymorepublic boolean isSessionImmutable()
SessionHolderisSessionImmutable in interface SessionHolderpublic SessionInfo getSessionInfo()
SessionHoldergetSessionInfo in interface SessionHolderpublic int getSessionInstanceNumber()
SessionHolder
Delegating getSession().getInstanceNumber() to
getSessionInstanceNumber allows to override
getSession and dynamically retrieve the thread's session
without changing the sorting order.
getSessionInstanceNumber in interface SessionHolderTentackle - distributed, domain- and model-driven