Class AbstractSessionManager<CC,MV,AV,SC>

java.lang.Object
org.wildfly.clustering.session.cache.AbstractSessionManager<CC,MV,AV,SC>
Type Parameters:
CC - the container 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<CC,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 System.Logger logger
      The logger for this session manager
  • Constructor Details

    • AbstractSessionManager

      protected AbstractSessionManager(AbstractSessionManager.Configuration<CC,MV,AV,SC> configuration)
      Creates a session manager using the specified configuration.
      Parameters:
      configuration - the configuration of the session manager
  • Method Details

    • isStarted

      public boolean isStarted()
      Description copied from interface: Service
      Indicates whether or not this service is started.
      Specified by:
      isStarted in interface Service
      Returns:
      true, if this service is started, false otherwise
    • start

      public void start()
      Description copied from interface: Service
      Starts this service.
      Specified by:
      start in interface Service
    • stop

      public void stop()
      Description copied from interface: Service
      Stops this service.
      Specified by:
      stop in interface Service
    • 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<CC>
      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<CC>
      Returns:
      a batcher
    • createSessionAsync

      public CompletionStage<Session<SC>> createSessionAsync(String id, Instant creationTime)
      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<CC>
      Parameters:
      id - a session identifier
      creationTime - the time this session was created
      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<CC>
      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<CC>
      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<CC>
      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<CC>
      Returns:
      an object from which statistics can be obtained.