public abstract class AbstractSessionManager extends org.apache.catalina.session.ManagerBase implements SessionManager, SessionManagerMBean, org.apache.catalina.Lifecycle
Modifier and Type | Field and Description |
---|---|
protected AtomicInteger |
averageAliveTime
Average time in ms a now expired session has been alive
|
protected AtomicInteger |
createdCounter
Number of sessions created by this manager
|
protected AtomicInteger |
duplicates
Number of times our session id generator has generated an id that matches an existing session.
|
protected AtomicInteger |
expiredCounter
Number of sessions that have been active locally that are now expired.
|
protected org.apache.catalina.util.LifecycleSupport |
lifecycle |
protected AtomicInteger |
localActiveCounter
Number of active sessions
|
protected int |
maxActiveAllowed
Maximum of active sessions allowed.
|
protected AtomicInteger |
maxActiveCounter
Maximum number of active sessions seen so far
|
protected AtomicInteger |
maxAliveTime
Maximum time in ms a now expired session has been alive
|
protected AtomicInteger |
maxLocalActiveCounter
Maximum number of concurrently locally active sessions
|
protected AtomicLong |
processingTime
Cumulative time spent in backgroundProcess
|
protected AtomicInteger |
rejectedCounter
number of sessions rejected because the number active sessions exceeds maxActive
|
protected boolean |
started
Has this component been started yet?
|
protected long |
timeSinceLastReset
Number of ms since last call to reset()
|
container, distributable, domain, expiredSessions, initialized, log, maxActive, maxInactiveInterval, mserver, name, oname, processExpiresFrequency, sessionAverageAliveTime, sessionCounter, sessionIdLength, sessionMaxAliveTime, sessions, sm, support
Modifier | Constructor and Description |
---|---|
protected |
AbstractSessionManager(org.jboss.metadata.web.jboss.JBossWebMetaData metaData) |
Modifier and Type | Method and Description |
---|---|
void |
addLifecycleListener(org.apache.catalina.LifecycleListener listener) |
protected int |
calcActiveSessions()
Calculates the number of active sessions, and updates the max # of local active sessions and max # of sessions.
|
String |
createSessionId(String realId,
String jvmRoute) |
org.apache.catalina.LifecycleListener[] |
findLifecycleListeners() |
long |
getActiveSessionCount()
Gets the number of sessions active on this node.
|
long |
getCreatedSessionCount()
Gets the number of sessions created on this node.
|
long |
getExpiredSessionCount()
Gets the number of sessions that have been expired on this node.
|
long |
getLocalActiveSessionCount()
Gets the count of sessions known to this manager, excluding those in the distributed stored that have not been accessed
on this node.
|
int |
getMaxActiveAllowed()
Gets the maximum number of
active sessions that will concurrently be allowed on this
node. |
long |
getMaxActiveSessionCount()
Gets the highest number of sessions concurrently active on this node.
|
int |
getMaxActiveSessions()
Gets the maximum number of active Sessions allowed, or -1 for no limit.
|
long |
getMaxLocalActiveSessionCount()
Gets the highest value seen for
#getLocalSessionCount() |
long |
getRejectedSessionCount()
Gets the number of times session creation has failed because the number of active sessions exceeds
maxActiveAllowed |
int |
getRejectedSessions()
Gets the number of sessions we rejected due to maxActive being reached.
|
ReplicationStatistics |
getReplicationStatistics()
Gets the replication statistics for the sessions managed by this manager.
|
long |
getTimeSinceLastReset()
Gets the elapsed time (in seconds) since this manager was instantiated or the last call to resetStats()
|
protected abstract int |
getTotalActiveSessions()
Get the total number of active sessions
|
void |
load() |
Map.Entry<String,String> |
parse(String sessionId) |
protected abstract void |
processExpirationPassivation() |
void |
processExpires() |
void |
removeLifecycleListener(org.apache.catalina.LifecycleListener listener) |
void |
resetStats()
Resets all statistics.
|
protected void |
sessionExpired(int sessionAliveTime)
Updates statistics to reflect that a session with a given "alive time" has been expired.
|
void |
setMaxActiveAllowed(int max)
Sets the maximum number of active sessions that will concurrently be allowed on this node, excluding any sessions that
have been passivated.
|
void |
setNewSessionCookie(String sessionId,
javax.servlet.http.HttpServletResponse response)
Sets a new cookie for the given session id and response
|
void |
setRejectedSessions(int rejectedSessions) |
void |
start() |
void |
stop() |
void |
unload() |
add, addPropertyChangeListener, appendJVMRoute, backgroundProcess, changeSessionId, createEmptySession, createSession, destroy, encode, expireSession, findSession, findSessions, generateSessionId, getActiveSessions, getClassName, getContainer, getCreationTime, getDistributable, getDomain, getDuplicates, getEngine, getExpiredSessions, getInfo, getJvmRoute, getLastAccessedTime, getMaxActive, getMaxInactiveInterval, getName, getNewSession, getObjectName, getProcessExpiresFrequency, getProcessingTime, getSession, getSessionAttribute, getSessionAverageAliveTime, getSessionCounter, getSessionIdLength, getSessionMaxAliveTime, init, listSessionIds, postDeregister, postRegister, preDeregister, preRegister, remove, removePropertyChangeListener, setContainer, setDistributable, setDuplicates, setExpiredSessions, setMaxActive, setMaxInactiveInterval, setProcessExpiresFrequency, setProcessingTime, setSessionAverageAliveTime, setSessionCounter, setSessionIdLength, setSessionMaxAliveTime
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getJvmRoute, locate, removeLocal, storeSession
add, addPropertyChangeListener, backgroundProcess, changeSessionId, createEmptySession, createSession, findSession, findSessions, getActiveSessions, getContainer, getDistributable, getExpiredSessions, getInfo, getMaxActive, getMaxInactiveInterval, getSessionAverageAliveTime, getSessionCounter, getSessionIdLength, getSessionMaxAliveTime, remove, removePropertyChangeListener, setContainer, setDistributable, setExpiredSessions, setMaxActive, setMaxInactiveInterval, setSessionAverageAliveTime, setSessionCounter, setSessionIdLength, setSessionMaxAliveTime
getActiveSessions, getClassName, getDistributable, getExpiredSessions, getMaxActive, getMaxInactiveInterval, getName, getProcessExpiresFrequency, getProcessingTime, getSessionAverageAliveTime, getSessionCounter, getSessionIdLength, getSessionMaxAliveTime, setDistributable, setMaxActive, setMaxInactiveInterval, setProcessExpiresFrequency, setProcessingTime, setSessionCounter, setSessionMaxAliveTime
protected int maxActiveAllowed
protected org.apache.catalina.util.LifecycleSupport lifecycle
protected volatile boolean started
protected AtomicInteger createdCounter
protected AtomicInteger rejectedCounter
protected AtomicInteger localActiveCounter
protected AtomicInteger maxLocalActiveCounter
protected AtomicInteger maxActiveCounter
protected AtomicInteger expiredCounter
protected long timeSinceLastReset
protected AtomicLong processingTime
protected AtomicInteger maxAliveTime
protected AtomicInteger averageAliveTime
protected AtomicInteger duplicates
protected AbstractSessionManager(org.jboss.metadata.web.jboss.JBossWebMetaData metaData)
public void start() throws org.apache.catalina.LifecycleException
start
in interface org.apache.catalina.Lifecycle
org.apache.catalina.LifecycleException
public void stop() throws org.apache.catalina.LifecycleException
stop
in interface org.apache.catalina.Lifecycle
org.apache.catalina.LifecycleException
public void processExpires()
processExpires
in class org.apache.catalina.session.ManagerBase
protected abstract void processExpirationPassivation()
public void addLifecycleListener(org.apache.catalina.LifecycleListener listener)
addLifecycleListener
in interface org.apache.catalina.Lifecycle
public org.apache.catalina.LifecycleListener[] findLifecycleListeners()
findLifecycleListeners
in interface org.apache.catalina.Lifecycle
public void removeLifecycleListener(org.apache.catalina.LifecycleListener listener)
removeLifecycleListener
in interface org.apache.catalina.Lifecycle
public int getRejectedSessions()
SessionManagerMBean
SessionManagerMBean.getRejectedSessionCount()
getRejectedSessions
in interface org.apache.catalina.Manager
getRejectedSessions
in interface SessionManagerMBean
public void setRejectedSessions(int rejectedSessions)
setRejectedSessions
in interface org.apache.catalina.Manager
public void load() throws ClassNotFoundException, IOException
load
in interface org.apache.catalina.Manager
ClassNotFoundException
IOException
public void unload() throws IOException
unload
in interface org.apache.catalina.Manager
IOException
public void setNewSessionCookie(String sessionId, javax.servlet.http.HttpServletResponse response)
SessionManager
setNewSessionCookie
in interface SessionManager
sessionId
- The session idpublic ReplicationStatistics getReplicationStatistics()
SessionManagerMBean
getReplicationStatistics
in interface SessionManagerMBean
public void resetStats()
SessionManagerMBean
resetStats
in interface SessionManagerMBean
public long getTimeSinceLastReset()
SessionManagerMBean
getTimeSinceLastReset
in interface SessionManagerMBean
public long getActiveSessionCount()
SessionManagerMBean
getActiveSessionCount
in interface SessionManagerMBean
public long getLocalActiveSessionCount()
SessionManagerMBean
getLocalActiveSessionCount
in interface SessionManagerMBean
public long getRejectedSessionCount()
SessionManagerMBean
maxActiveAllowed
getRejectedSessionCount
in interface SessionManagerMBean
public long getCreatedSessionCount()
SessionManagerMBean
getCreatedSessionCount
in interface SessionManagerMBean
public long getExpiredSessionCount()
SessionManagerMBean
getExpiredSessionCount
in interface SessionManagerMBean
public long getMaxActiveSessionCount()
SessionManagerMBean
getMaxActiveSessionCount
in interface SessionManagerMBean
public long getMaxLocalActiveSessionCount()
SessionManagerMBean
#getLocalSessionCount()
getMaxLocalActiveSessionCount
in interface SessionManagerMBean
public int getMaxActiveAllowed()
SessionManagerMBean
active sessions
that will concurrently be allowed on this
node. This includes replicated sessions that have not been accessed on this node.getMaxActiveAllowed
in interface SessionManagerMBean
public void setMaxActiveAllowed(int max)
SessionManagerMBean
active session count
exceeds this value and an attempt to create a new session is made,
session creation will fail with an IllegalStateException
.setMaxActiveAllowed
in interface SessionManagerMBean
max
- the max number of sessions, or -1
if there is no limit.public int getMaxActiveSessions()
SessionManagerMBean
getMaxActiveSessions
in interface SessionManagerMBean
public Map.Entry<String,String> parse(String sessionId)
parse
in interface SessionManager
public String createSessionId(String realId, String jvmRoute)
createSessionId
in interface SessionManager
protected void sessionExpired(int sessionAliveTime)
sessionAliveTime
- number of ms from when the session was created to when it was expired.protected int calcActiveSessions()
Call this method when a new session is added or when an accurate count of active sessions is needed.
protected abstract int getTotalActiveSessions()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.