Class DetachedSession<C>

java.lang.Object
org.wildfly.clustering.session.cache.AbstractImmutableSession
org.wildfly.clustering.session.cache.DetachedSession<C>
Type Parameters:
C - the session context
All Implemented Interfaces:
AutoCloseable, ImmutableSession, Session<C>

public class DetachedSession<C> extends AbstractImmutableSession implements Session<C>
Detached session implementation, for use outside the context of a request.
Author:
Paul Ferraro
  • Constructor Details

    • DetachedSession

      public DetachedSession(SessionManager<C> manager, String id, C context)
      Creates a detached session.
      Parameters:
      manager - the session manager
      id - the identifier of the detached session
      context - the context of the detached session
  • Method Details

    • getMetaData

      public SessionMetaData getMetaData()
      Description copied from interface: ImmutableSession
      Returns this session's meta data.
      Specified by:
      getMetaData in interface ImmutableSession
      Specified by:
      getMetaData in interface Session<C>
      Returns:
      this session's meta data
    • getAttributes

      public Map<String,Object> getAttributes()
      Description copied from interface: ImmutableSession
      Returns this session's attributes.
      Specified by:
      getAttributes in interface ImmutableSession
      Returns:
      this session's attributes
    • getContext

      public C getContext()
      Description copied from interface: Session
      Returns the local context of this session. The local context is *not* replicated to other nodes in the cluster.
      Specified by:
      getContext in interface Session<C>
      Returns:
      a local context
    • isValid

      public boolean isValid()
      Description copied from interface: ImmutableSession
      Indicates whether or not this session is valid.
      Specified by:
      isValid in interface ImmutableSession
      Returns:
      true, if this session is valid, false otherwise
    • invalidate

      public void invalidate()
      Description copied from interface: Session
      Invalidates this session.
      Specified by:
      invalidate in interface Session<C>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Session<C>