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 typeMV- the session metadata value typeAV- the session attribute value typeSC- 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceConfiguration of a session manager. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final System.LoggerThe logger for this session manager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSessionManager(AbstractSessionManager.Configuration<CC, MV, AV, SC> configuration) Creates a session manager using the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptioncreateSessionAsync(String id, Instant creationTime) Creates a session using the specified identifier.Returns a read-only view of the session with the specified identifier.Returns the session with the specified identifier, or null if none exists.Returns a batcher for use by users of this manager.Returns a detached session with the specified identifier.Returns a factory for creating identifiers for use by this manager.Returns statistics for this session manager.booleanIndicates whether or not this service is started.voidstart()Starts this service.voidstop()Stops this service.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SessionManager
createSession, createSession, createSessionAsync, findImmutableSession, findSessionMethods inherited from interface SessionStatistics
getActiveSessionCount, getActiveSessions, getSessions
-
Field Details
-
logger
The logger for this session manager
-
-
Constructor Details
-
AbstractSessionManager
Creates a session manager using the specified configuration.- Parameters:
configuration- the configuration of the session manager
-
-
Method Details
-
isStarted
-
start
-
stop
-
getIdentifierFactory
Description copied from interface:ManagerConfigurationReturns a factory for creating identifiers for use by this manager.- Specified by:
getIdentifierFactoryin interfaceManagerConfiguration<CC>- Returns:
- an identifier factory
-
getBatchFactory
-
createSessionAsync
Description copied from interface:SessionManagerCreates a session using the specified identifier. Sessions returned by this method must be closed viaSession.close(). This method is intended to be invoked within the context of a batch.- Specified by:
createSessionAsyncin interfaceSessionManager<CC>- Parameters:
id- a session identifiercreationTime- the time this session was created- Returns:
- a new web session, or null if a session with the specified identifier already exists.
-
findSessionAsync
Description copied from interface:SessionManagerReturns the session with the specified identifier, or null if none exists. Sessions returned by this method must be closed viaSession.close(). This method is intended to be invoked within the context of a batch.- Specified by:
findSessionAsyncin interfaceSessionManager<CC>- Parameters:
id- a session identifier- Returns:
- an existing web session, or null if none exists
-
findImmutableSessionAsync
Description copied from interface:SessionManagerReturns 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:
findImmutableSessionAsyncin interfaceSessionManager<CC>- Parameters:
id- a unique session identifier- Returns:
- a read-only session or null if none exists
-
getDetachedSession
Description copied from interface:SessionManagerReturns a detached session with the specified identifier. A detached session is only valid if a session exists for the given identifier.- Specified by:
getDetachedSessionin interfaceSessionManager<CC>- Parameters:
id- the session identifier of the detached session- Returns:
- a detached session
-
getStatistics
Description copied from interface:SessionManagerReturns statistics for this session manager.- Specified by:
getStatisticsin interfaceSessionManager<CC>- Returns:
- an object from which statistics can be obtained.
-