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, setSessionMaxAliveTimeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetJvmRoute, locate, removeLocal, storeSessionadd, 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, setSessionMaxAliveTimegetActiveSessions, getClassName, getDistributable, getExpiredSessions, getMaxActive, getMaxInactiveInterval, getName, getProcessExpiresFrequency, getProcessingTime, getSessionAverageAliveTime, getSessionCounter, getSessionIdLength, getSessionMaxAliveTime, setDistributable, setMaxActive, setMaxInactiveInterval, setProcessExpiresFrequency, setProcessingTime, setSessionCounter, setSessionMaxAliveTimeprotected 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.Lifecycleorg.apache.catalina.LifecycleExceptionpublic void stop()
throws org.apache.catalina.LifecycleException
stop in interface org.apache.catalina.Lifecycleorg.apache.catalina.LifecycleExceptionpublic void processExpires()
processExpires in class org.apache.catalina.session.ManagerBaseprotected abstract void processExpirationPassivation()
public void addLifecycleListener(org.apache.catalina.LifecycleListener listener)
addLifecycleListener in interface org.apache.catalina.Lifecyclepublic org.apache.catalina.LifecycleListener[] findLifecycleListeners()
findLifecycleListeners in interface org.apache.catalina.Lifecyclepublic void removeLifecycleListener(org.apache.catalina.LifecycleListener listener)
removeLifecycleListener in interface org.apache.catalina.Lifecyclepublic int getRejectedSessions()
SessionManagerMBeanSessionManagerMBean.getRejectedSessionCount()getRejectedSessions in interface org.apache.catalina.ManagergetRejectedSessions in interface SessionManagerMBeanpublic void setRejectedSessions(int rejectedSessions)
setRejectedSessions in interface org.apache.catalina.Managerpublic void load()
throws ClassNotFoundException,
IOException
load in interface org.apache.catalina.ManagerClassNotFoundExceptionIOExceptionpublic void unload()
throws IOException
unload in interface org.apache.catalina.ManagerIOExceptionpublic void setNewSessionCookie(String sessionId, javax.servlet.http.HttpServletResponse response)
SessionManagersetNewSessionCookie in interface SessionManagersessionId - The session idpublic ReplicationStatistics getReplicationStatistics()
SessionManagerMBeangetReplicationStatistics in interface SessionManagerMBeanpublic void resetStats()
SessionManagerMBeanresetStats in interface SessionManagerMBeanpublic long getTimeSinceLastReset()
SessionManagerMBeangetTimeSinceLastReset in interface SessionManagerMBeanpublic long getActiveSessionCount()
SessionManagerMBeangetActiveSessionCount in interface SessionManagerMBeanpublic long getLocalActiveSessionCount()
SessionManagerMBeangetLocalActiveSessionCount in interface SessionManagerMBeanpublic long getRejectedSessionCount()
SessionManagerMBeanmaxActiveAllowedgetRejectedSessionCount in interface SessionManagerMBeanpublic long getCreatedSessionCount()
SessionManagerMBeangetCreatedSessionCount in interface SessionManagerMBeanpublic long getExpiredSessionCount()
SessionManagerMBeangetExpiredSessionCount in interface SessionManagerMBeanpublic long getMaxActiveSessionCount()
SessionManagerMBeangetMaxActiveSessionCount in interface SessionManagerMBeanpublic long getMaxLocalActiveSessionCount()
SessionManagerMBean#getLocalSessionCount()getMaxLocalActiveSessionCount in interface SessionManagerMBeanpublic int getMaxActiveAllowed()
SessionManagerMBeanactive sessions that will concurrently be allowed on this
node. This includes replicated sessions that have not been accessed on this node.getMaxActiveAllowed in interface SessionManagerMBeanpublic void setMaxActiveAllowed(int max)
SessionManagerMBeanactive 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 SessionManagerMBeanmax - the max number of sessions, or -1 if there is no limit.public int getMaxActiveSessions()
SessionManagerMBeangetMaxActiveSessions in interface SessionManagerMBeanpublic Map.Entry<String,String> parse(String sessionId)
parse in interface SessionManagerpublic String createSessionId(String realId, String jvmRoute)
createSessionId in interface SessionManagerprotected 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.