Class SessionWebScope

  • All Implemented Interfaces:
    com.helger.commons.id.IHasID<String>, com.helger.datetime.domain.IHasCreationDateTime, com.helger.scope.IScope, com.helger.scope.ISessionScope, ISessionWebScope, IWebScope

    @ThreadSafe
    public class SessionWebScope
    extends com.helger.scope.SessionScope
    implements ISessionWebScope
    Default implementation of the ISessionWebScope interface. It is serializable in general, but just don't do it :)
    Author:
    Philip Helger
    • Field Summary

      • Fields inherited from class com.helger.scope.AbstractScope

        m_aRWLock
    • Constructor Summary

      Constructors 
      Constructor Description
      SessionWebScope​(jakarta.servlet.http.HttpSession aHttpSession)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object o)  
      LocalDateTime getCreationDateTime()  
      jakarta.servlet.http.HttpSession getSession()
      Get the underlying HTTP session.
      int hashCode()  
      void initScope()  
      com.helger.commons.state.EContinue selfDestruct()  
      String toString()  
      • Methods inherited from class com.helger.scope.SessionScope

        postDestroy, preDestroy
      • Methods inherited from class com.helger.scope.AbstractScope

        attrs, destroyScope, getID, isDestroyed, isInDestruction, isInPreDestruction, isValid, runAtomic, runAtomic
      • Methods inherited from interface com.helger.datetime.domain.IHasCreationDateTime

        getCreationDate, getCreationTime, hasCreationDateTime, isCreatedAt
      • Methods inherited from interface com.helger.scope.IScope

        attrs, destroyScope, getAllScopeRenewalAwareAttributes, getID, isDestroyed, isInDestruction, isValid, runAtomic, runAtomic
    • Constructor Detail

      • SessionWebScope

        public SessionWebScope​(@Nonnull
                               jakarta.servlet.http.HttpSession aHttpSession)
    • Method Detail

      • getCreationDateTime

        @Nonnull
        public final LocalDateTime getCreationDateTime()
        Specified by:
        getCreationDateTime in interface com.helger.datetime.domain.IHasCreationDateTime
        Specified by:
        getCreationDateTime in interface IWebScope
        Returns:
        The date and time when this web scope was created. Never null.
      • initScope

        public void initScope()
        Specified by:
        initScope in interface com.helger.scope.IScope
        Overrides:
        initScope in class com.helger.scope.SessionScope
      • selfDestruct

        @Nonnull
        public com.helger.commons.state.EContinue selfDestruct()
        Specified by:
        selfDestruct in interface com.helger.scope.ISessionScope
        Overrides:
        selfDestruct in class com.helger.scope.SessionScope
      • getSession

        @Nonnull
        public jakarta.servlet.http.HttpSession getSession()
        Description copied from interface: ISessionWebScope
        Get the underlying HTTP session. Important: do not use it to access the attributes within the session. Use only the scope API for this, so that the synchronization is consistent!
        Specified by:
        getSession in interface ISessionWebScope
        Returns:
        The underlying HTTP session. Never null.
      • equals

        public boolean equals​(Object o)
        Overrides:
        equals in class com.helger.scope.AbstractScope
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class com.helger.scope.AbstractScope
      • toString

        public String toString()
        Overrides:
        toString in class com.helger.scope.AbstractScope