Class AbstractSessionManager<C,MV,AV,SC>

java.lang.Object
org.wildfly.clustering.session.cache.AbstractSessionManager<C,MV,AV,SC>
Type Parameters:
C - the session manager context type
MV - the session metadata value type
AV - the session attribute value type
SC - the session context type
All Implemented Interfaces:
Manager<String>, ManagerConfiguration<String>, Service, SessionManager<SC>, SessionStatistics
Direct Known Subclasses:
HotRodSessionManager, InfinispanSessionManager

public abstract class AbstractSessionManager<C,MV,AV,SC> extends Object implements SessionManager<SC>, SessionStatistics
An abstract SessionManager implementation that delegates most implementation details to a SessionFactory.
Author:
Paul Ferraro
  • Field Details

    • logger

      protected final org.jboss.logging.Logger logger
  • Constructor Details

  • Method Details

    • getIdentifierFactory

      public Supplier<String> getIdentifierFactory()
      Description copied from interface: ManagerConfiguration
      Returns a factory for creating identifiers for use by this manager.
      Specified by:
      getIdentifierFactory in interface ManagerConfiguration<C>
      Returns:
      an identifier factory
    • getBatchFactory

      public Supplier<Batch> getBatchFactory()
      Description copied from interface: Manager
      Returns a batcher for use by users of this manager.
      Specified by:
      getBatchFactory in interface Manager<C>
      Returns:
      a batcher
    • createSessionAsync

      public CompletionStage<Session<SC>> createSessionAsync(String id)
      Description copied from interface: SessionManager
      Creates a session using the specified identifier. Sessions returned by this method must be closed via Session.close(). This method is intended to be invoked within the context of a batch.
      Specified by:
      createSessionAsync in interface SessionManager<C>
      Parameters:
      id - a session identifier
      Returns:
      a new web session, or null if a session with the specified identifier already exists.
    • findSessionAsync

      public CompletionStage<Session<SC>> findSessionAsync(String id)
      Description copied from interface: SessionManager
      Returns the session with the specified identifier, or null if none exists. Sessions returned by this method must be closed via Session.close(). This method is intended to be invoked within the context of a batch.
      Specified by:
      findSessionAsync in interface SessionManager<C>
      Parameters:
      id - a session identifier
      Returns:
      an existing web session, or null if none exists
    • findImmutableSessionAsync

      public CompletionStage<ImmutableSession> findImmutableSessionAsync(String id)
      Description copied from interface: SessionManager
      Returns a read-only view of the session with the specified identifier. This method is intended to be invoked within the context of a batch
      Specified by:
      findImmutableSessionAsync in interface SessionManager<C>
      Parameters:
      id - a unique session identifier
      Returns:
      a read-only session or null if none exists
    • getDetachedSession

      public Session<SC> getDetachedSession(String id)
      Description copied from interface: SessionManager
      Returns a detached session with the specified identifier. A detached session is only valid if a session exists for the given identifier.
      Specified by:
      getDetachedSession in interface SessionManager<C>
      Parameters:
      id - the session identifier of the detached session
      Returns:
      a detached session
    • getStatistics

      public SessionStatistics getStatistics()
      Description copied from interface: SessionManager
      Returns statistics for this session manager.
      Specified by:
      getStatistics in interface SessionManager<C>
      Returns:
      an object from which statistics can be obtained.