Top Description Inners Fields Constructors Methods
io.undertow.server.session

public Class InMemorySessionManager

extends Object
implements SessionManager, SessionManagerStatistics
Class Inheritance
All Implemented Interfaces
io.undertow.server.session.SessionManagerStatistics, io.undertow.server.session.SessionManager
Imports
io.undertow.UndertowLogger, .UndertowMessages, io.undertow.server.HttpServerExchange, io.undertow.util.AttachmentKey, .ConcurrentDirectDeque, .WorkerUtils, java.math.BigDecimal, .BigInteger, .MathContext, java.security.AccessController, .PrivilegedAction, java.util.HashSet, .Map, .Set, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, .TimeUnit, java.util.concurrent.atomic.AtomicInteger, .AtomicLong, .AtomicReferenceFieldUpdater, org.xnio.XnioExecutor, .XnioIoThread, .XnioWorker

The default in memory session manager. This basically just stores sessions in an in memory hash map.

Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
InMemorySessionManager.SessionImpl

session implementation for the in memory session manager

Field Summary

Modifier and TypeField and Description
private final AtomicLong
private volatile int
defaultSessionTimeout

30 minute default

private final String
private final ConcurrentDirectDeque<String>
private volatile long
private final boolean
private final AtomicInteger
private volatile long
private final int
private final AttachmentKey<InMemorySessionManager.SessionImpl>
private final AtomicLong
private final SessionIdGenerator
private final SessionListeners
private final ConcurrentMap<String, InMemorySessionManager.SessionImpl>
private volatile long
private final boolean
private volatile BigInteger

Constructor Summary

AccessConstructor and Description
public
InMemorySessionManager(String deploymentName, int maxSessions, boolean expireOldestUnusedSessionOnMax)

public
InMemorySessionManager(SessionIdGenerator sessionIdGenerator, String deploymentName, int maxSessions, boolean expireOldestUnusedSessionOnMax)

public
InMemorySessionManager(SessionIdGenerator sessionIdGenerator, String deploymentName, int maxSessions, boolean expireOldestUnusedSessionOnMax, boolean statisticsEnabled)

public
InMemorySessionManager(String deploymentName, int maxSessions)

public

Method Summary

Modifier and TypeMethod and Description
private String
public Session
createSession(final HttpServerExchange serverExchange, final SessionConfig config)

Implements io.undertow.server.session.SessionManager.createSession.

Creates a new session.

public boolean
equals(Object
the reference object with which to compare.
object
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public long
public Set<String>
getActiveSessions()

Implements io.undertow.server.session.SessionManager.getActiveSessions.

Returns the identifiers of those sessions that are active on this node, excluding passivated sessions

public Set<String>
getAllSessions()

Implements io.undertow.server.session.SessionManager.getAllSessions.

Returns the identifiers of all sessions, including both active and passive

public synchronized long
public long
public String
getDeploymentName()

Implements io.undertow.server.session.SessionManager.getDeploymentName.

Uniquely identifies this session manager

public long
public long
public long
public long
public long
public Session
public Session
getSession(String
The session ID
sessionId
)

Implements io.undertow.server.session.SessionManager.getSession.

Retrieves a session with the given session id

public long
public SessionManagerStatistics
getStatistics()

Implements io.undertow.server.session.SessionManager.getStatistics.

Returns the statistics for this session manager, or null, if statistics are not supported.

public Set<String>
getTransientSessions()

Implements io.undertow.server.session.SessionManager.getTransientSessions.

Returns the identifiers of those sessions that would be lost upon shutdown of this node

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public synchronized void
registerSessionListener(final SessionListener
The listener
listener
)

Implements io.undertow.server.session.SessionManager.registerSessionListener.

Registers a session listener for the session manager

public synchronized void
removeSessionListener(final SessionListener
the listener
listener
)

Implements io.undertow.server.session.SessionManager.removeSessionListener.

Removes a session listener from the session manager

private boolean
public void
setDefaultSessionTimeout(final int
the timeout
timeout
)

Implements io.undertow.server.session.SessionManager.setDefaultSessionTimeout.

Sets the default session timeout

public void
start()

Implements io.undertow.server.session.SessionManager.start.

Starts the session manager

public void
stop()

Implements io.undertow.server.session.SessionManager.stop.

stops the session manager

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait