Class DeltaSessionManager<CommitSessionValveT extends AbstractCommitSessionValve<?>>
- java.lang.Object
-
- org.apache.catalina.session.ManagerBase
-
- org.apache.geode.modules.session.catalina.DeltaSessionManager<CommitSessionValveT>
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
,javax.management.MBeanRegistration
,org.apache.catalina.Lifecycle
,org.apache.catalina.Manager
,SessionManager
- Direct Known Subclasses:
Tomcat6DeltaSessionManager
,Tomcat7DeltaSessionManager
,Tomcat8DeltaSessionManager
,Tomcat9DeltaSessionManager
public abstract class DeltaSessionManager<CommitSessionValveT extends AbstractCommitSessionValve<?>> extends org.apache.catalina.session.ManagerBase implements org.apache.catalina.Lifecycle, java.beans.PropertyChangeListener, SessionManager
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
The name of thisManager
protected java.lang.String
regionName
protected java.util.concurrent.atomic.AtomicBoolean
started
Has thisManager
been started?-
Fields inherited from class org.apache.catalina.session.ManagerBase
algorithm, container, DEFAULT_ALGORITHM, devRandomSource, digest, distributable, domain, duplicates, entropy, expiredSessions, initialized, log, maxActive, maxInactiveInterval, mserver, oname, processExpiresFrequency, processingTime, random, randomClass, randomIS, sessionAverageAliveTime, sessionCounter, sessionCreationTiming, sessionExpirationTiming, sessionIdLength, sessionMaxAliveTime, sessions, sm, support, TIMING_STATS_CACHE_SIZE
-
-
Constructor Summary
Constructors Constructor Description DeltaSessionManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(org.apache.catalina.Session session)
protected void
cancelTimer()
protected abstract CommitSessionValveT
createCommitSessionValve()
org.apache.catalina.Session
findSession(java.lang.String id)
int
getActiveSessions()
Returns the number of active sessionsboolean
getEnableDebugListener()
boolean
getEnableGatewayDeltaReplication()
boolean
getEnableGatewayReplication()
boolean
getEnableLocalCache()
org.apache.juli.logging.Log
getLogger()
int
getMaxActiveSessions()
protected org.apache.catalina.session.StandardSession
getNewSession()
boolean
getPreferDeserializedForm()
Deprecated.No replacement.java.lang.String
getRegionAttributesId()
java.lang.String
getRegionName()
int
getRejectedSessions()
SessionCache
getSessionCache()
protected java.util.Set<java.lang.String>
getSessionsToTouch()
org.apache.geode.modules.session.catalina.internal.DeltaSessionStatistics
getStatistics()
java.lang.String
getStatisticsName()
org.apache.catalina.Context
getTheContext()
protected void
initializeSessionCache()
boolean
isBackingCacheAvailable()
boolean
isClientServer()
boolean
isCommitValveEnabled()
boolean
isCommitValveFailfastEnabled()
java.lang.String
listSessionIds()
For debugging: return a list of all session ids currently activevoid
load()
void
propertyChange(java.beans.PropertyChangeEvent event)
Process property change events from our associated Context.protected void
registerCommitSessionValve()
protected void
registerJvmRouteBinderValve()
void
remove(org.apache.catalina.Session session)
protected void
scheduleTimerTasks()
void
setContainer(org.apache.catalina.Container container)
This method was taken from StandardManager to set the default maxInactiveInterval based on the container (to 30 minutes).void
setEnableCommitValve(boolean enable)
void
setEnableCommitValveFailfast(boolean enable)
void
setEnableDebugListener(boolean enableDebugListener)
void
setEnableGatewayDeltaReplication(boolean enableGatewayDeltaReplication)
void
setEnableGatewayReplication(boolean enableGatewayReplication)
void
setEnableLocalCache(boolean enableLocalCache)
void
setMaxActiveSessions(int maxActiveSessions)
void
setMaxInactiveInterval(int interval)
void
setPreferDeserializedForm(boolean enable)
Deprecated.No replacement.void
setRegionAttributesId(java.lang.String regionType)
void
setRegionName(java.lang.String regionName)
void
setRejectedSessions(int rejectedSessions)
java.lang.String
toString()
void
unload()
protected void
unregisterCommitSessionValve()
protected void
unregisterJvmRouteBinderValve()
-
Methods inherited from class org.apache.catalina.session.ManagerBase
addPropertyChangeListener, backgroundProcess, changeSessionId, createEmptySession, createSession, createSession, destroy, expireSession, findSessions, generateSessionId, getAlgorithm, getClassName, getContainer, getCreationTime, getCreationTimestamp, getDigest, getDistributable, getDomain, getDuplicates, getEngine, getEntropy, getExpiredSessions, getInfo, getJvmRoute, getLastAccessedTime, getLastAccessedTimestamp, getMaxActive, getMaxInactiveInterval, getName, getObjectName, getProcessExpiresFrequency, getProcessingTime, getRandom, getRandomBytes, getRandomClass, getRandomFile, getSession, getSessionAttribute, getSessionAverageAliveTime, getSessionCounter, getSessionCreateRate, getSessionExpireRate, getSessionIdLength, getSessionMaxAliveTime, init, postDeregister, postRegister, preDeregister, preRegister, processExpires, removePropertyChangeListener, setAlgorithm, setDistributable, setDuplicates, setEntropy, setExpiredSessions, setMaxActive, setProcessExpiresFrequency, setProcessingTime, setRandomClass, setRandomFile, setSessionAverageAliveTime, setSessionCounter, setSessionIdLength, setSessionMaxAliveTime
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.catalina.Lifecycle
addLifecycleListener, findLifecycleListeners, removeLifecycleListener, start, stop
-
Methods inherited from interface org.apache.geode.modules.session.catalina.SessionManager
getMaxInactiveInterval
-
-
-
-
Method Detail
-
getRegionName
public java.lang.String getRegionName()
- Specified by:
getRegionName
in interfaceSessionManager
-
setRegionName
public void setRegionName(java.lang.String regionName)
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
- Specified by:
setMaxInactiveInterval
in interfaceorg.apache.catalina.Manager
- Overrides:
setMaxInactiveInterval
in classorg.apache.catalina.session.ManagerBase
-
getRegionAttributesId
public java.lang.String getRegionAttributesId()
- Specified by:
getRegionAttributesId
in interfaceSessionManager
-
setRegionAttributesId
public void setRegionAttributesId(java.lang.String regionType)
-
getEnableLocalCache
public boolean getEnableLocalCache()
- Specified by:
getEnableLocalCache
in interfaceSessionManager
-
setEnableLocalCache
public void setEnableLocalCache(boolean enableLocalCache)
-
getMaxActiveSessions
public int getMaxActiveSessions()
-
setMaxActiveSessions
public void setMaxActiveSessions(int maxActiveSessions)
-
getEnableGatewayDeltaReplication
public boolean getEnableGatewayDeltaReplication()
- Specified by:
getEnableGatewayDeltaReplication
in interfaceSessionManager
-
setEnableGatewayDeltaReplication
public void setEnableGatewayDeltaReplication(boolean enableGatewayDeltaReplication)
-
getEnableGatewayReplication
public boolean getEnableGatewayReplication()
- Specified by:
getEnableGatewayReplication
in interfaceSessionManager
-
setEnableGatewayReplication
public void setEnableGatewayReplication(boolean enableGatewayReplication)
-
getEnableDebugListener
public boolean getEnableDebugListener()
- Specified by:
getEnableDebugListener
in interfaceSessionManager
-
setEnableDebugListener
public void setEnableDebugListener(boolean enableDebugListener)
-
isCommitValveEnabled
public boolean isCommitValveEnabled()
- Specified by:
isCommitValveEnabled
in interfaceSessionManager
-
setEnableCommitValve
public void setEnableCommitValve(boolean enable)
-
isCommitValveFailfastEnabled
public boolean isCommitValveFailfastEnabled()
- Specified by:
isCommitValveFailfastEnabled
in interfaceSessionManager
-
setEnableCommitValveFailfast
public void setEnableCommitValveFailfast(boolean enable)
-
isBackingCacheAvailable
public boolean isBackingCacheAvailable()
- Specified by:
isBackingCacheAvailable
in interfaceSessionManager
-
setPreferDeserializedForm
@Deprecated public void setPreferDeserializedForm(boolean enable)
Deprecated.No replacement. Always prefer deserialized form.
-
getPreferDeserializedForm
@Deprecated public boolean getPreferDeserializedForm()
Deprecated.No replacement. Always prefer deserialized form.- Specified by:
getPreferDeserializedForm
in interfaceSessionManager
- Returns:
- whether to prefer deserialized form
-
getStatisticsName
public java.lang.String getStatisticsName()
- Specified by:
getStatisticsName
in interfaceSessionManager
-
getLogger
public org.apache.juli.logging.Log getLogger()
- Specified by:
getLogger
in interfaceSessionManager
-
getSessionCache
public SessionCache getSessionCache()
-
getStatistics
public org.apache.geode.modules.session.catalina.internal.DeltaSessionStatistics getStatistics()
-
isClientServer
public boolean isClientServer()
-
setContainer
public void setContainer(org.apache.catalina.Container container)
This method was taken from StandardManager to set the default maxInactiveInterval based on the container (to 30 minutes).Set the Container with which this Manager has been associated. If it is a Context (the usual case), listen for changes to the session timeout property.
- Specified by:
setContainer
in interfaceorg.apache.catalina.Manager
- Overrides:
setContainer
in classorg.apache.catalina.session.ManagerBase
- Parameters:
container
- The associated Container
-
findSession
public org.apache.catalina.Session findSession(java.lang.String id)
- Specified by:
findSession
in interfaceorg.apache.catalina.Manager
- Overrides:
findSession
in classorg.apache.catalina.session.ManagerBase
-
initializeSessionCache
protected void initializeSessionCache()
-
getNewSession
protected org.apache.catalina.session.StandardSession getNewSession()
- Overrides:
getNewSession
in classorg.apache.catalina.session.ManagerBase
-
remove
public void remove(org.apache.catalina.Session session)
- Specified by:
remove
in interfaceorg.apache.catalina.Manager
- Overrides:
remove
in classorg.apache.catalina.session.ManagerBase
-
add
public void add(org.apache.catalina.Session session)
- Specified by:
add
in interfaceorg.apache.catalina.Manager
- Overrides:
add
in classorg.apache.catalina.session.ManagerBase
-
getRejectedSessions
public int getRejectedSessions()
- Specified by:
getRejectedSessions
in interfaceorg.apache.catalina.Manager
-
setRejectedSessions
public void setRejectedSessions(int rejectedSessions)
- Specified by:
setRejectedSessions
in interfaceorg.apache.catalina.Manager
-
getActiveSessions
public int getActiveSessions()
Returns the number of active sessions- Specified by:
getActiveSessions
in interfaceorg.apache.catalina.Manager
- Overrides:
getActiveSessions
in classorg.apache.catalina.session.ManagerBase
- Returns:
- number of sessions active
-
listSessionIds
public java.lang.String listSessionIds()
For debugging: return a list of all session ids currently active- Overrides:
listSessionIds
in classorg.apache.catalina.session.ManagerBase
-
getSessionsToTouch
protected java.util.Set<java.lang.String> getSessionsToTouch()
-
scheduleTimerTasks
protected void scheduleTimerTasks()
-
cancelTimer
protected void cancelTimer()
-
load
public void load() throws java.lang.ClassNotFoundException, java.io.IOException
- Specified by:
load
in interfaceorg.apache.catalina.Manager
- Throws:
java.lang.ClassNotFoundException
java.io.IOException
-
unload
public void unload() throws java.io.IOException
- Specified by:
unload
in interfaceorg.apache.catalina.Manager
- Throws:
java.io.IOException
-
registerJvmRouteBinderValve
protected void registerJvmRouteBinderValve()
-
unregisterJvmRouteBinderValve
protected void unregisterJvmRouteBinderValve()
-
registerCommitSessionValve
protected void registerCommitSessionValve()
-
createCommitSessionValve
protected abstract CommitSessionValveT createCommitSessionValve()
-
unregisterCommitSessionValve
protected void unregisterCommitSessionValve()
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent event)
Process property change events from our associated Context.Part of this method implementation was taken from StandardManager. The sessionTimeout can be changed in the web.xml which is processed after the context.xml. The context (and the default session timeout) would already have been set in this Manager. This is the way to get the new session timeout value specified in the web.xml.
The precedence order for setting the session timeout value is:
- the max inactive interval is set based on the Manager defined in the context.xml
- the max inactive interval is then overwritten by the value of the Context's session timeout when setContainer is called
- the max inactive interval is then overwritten by the value of the session-timeout specified in the web.xml (if any)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Parameters:
event
- The property change event that has occurred
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getTheContext
public org.apache.catalina.Context getTheContext()
-
-