Interface SessionHolder

All Superinterfaces:
Serializable
All Known Implementing Classes:
ThreadLocalSessionHolder

public interface SessionHolder extends Serializable
Holder for a session.
Author:
harald
  • Method Details

    • getSession

      Session getSession()
      Gets the session.
      The thread-local session is returned if the session is null.
      Returns:
      the session.
    • setSession

      void setSession(Session session)
      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() to getSessionInstanceNumber allows to override getSession and dynamically retrieve the thread's session without changing the sorting order.

      Returns:
      the session's instance number