Class HttpSessionManager
- java.lang.Object
-
- com.tangosol.util.Base
-
- com.tangosol.coherence.servlet.management.HttpSessionManager
-
- All Implemented Interfaces:
HttpSessionManagerMBean
public class HttpSessionManager extends Base implements HttpSessionManagerMBean
HttpSessionManagerMBean implementation class.- Since:
- Coherence 3.1
- Author:
- jh 2005.11.18
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
-
Field Summary
-
Fields inherited from class com.tangosol.util.Base
LOG_ALWAYS, LOG_CONFIG, LOG_DEBUG, LOG_ERR, LOG_INFO, LOG_MAX, LOG_MIN, LOG_QUIET, LOG_WARN, POWER_0, POWER_G, POWER_K, POWER_M, POWER_T, UNIT_D, UNIT_H, UNIT_M, UNIT_MS, UNIT_NS, UNIT_S, UNIT_US
-
Fields inherited from interface com.tangosol.coherence.servlet.management.HttpSessionManagerMBean
OBJECT_TYPE
-
-
Constructor Summary
Constructors Constructor Description HttpSessionManager(SessionHelper helper, SessionReaperStatistics reaperStatistics)
Create a new HttpSessionManager object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearStoredConfiguration()
Removes the stored configuration which is used to check configuration consistency.protected AbstractHttpSessionCollection
getAbstractHttpSessionCollection()
Return the AbstractHttpSessionCollection currently in use.long
getAverageReapDuration()
Gets the average reap duration since the statistics was reset.long
getAverageReapedSessions()
Gets the average number of reaped sessions in a reap cycle since the statistics was reset.long
getAverageReapQueueWaitDuration()
Return the average number of milliseconds reap tasks wait in the queue prior to running.String
getCollectionClassName()
Return the fully qualified class name of theHttpSessionCollection
implementation in use.String
getFactoryClassName()
Return the fully qualified class name of theSessionHelperFactory
implementation in use.Date
getLastReapCycle()
Return the start time for the last reap cycle.long
getLastReapDuration()
Return the time in milliseconds it took for the last reap cycle to finish.long
getLastReapQueueWaitDuration()
Return the time the last reap task spent in the queue prior to running.String
getLocalAttributeCacheName()
Return the name of the local cache that stores non-distributed session attributes or null if local session attribute storage is disabled.int
getLocalAttributeCount()
Return the number of non-distributed session attributes stored in the local session attribute cache or -1 if local session attribute storage is disabled.String
getLocalSessionCacheName()
Return the name of the local cache that stores non-distributed sessions or null if local session storage is disabled.int
getLocalSessionCount()
Return the number of non-distributed sessions stored in the local session cache or -1 if local session storage is disabled.long
getMaxReapDuration()
Gets the maximum reap duration since the statistics was reset.long
getMaxReapedSessions()
Gets the maximum number of sessions reaped in a reap cycle since the statistics was reset.long
getMaxReapQueueWaitDuration()
Return the max time in milliseconds a reap task has spent in the queue prior to running since the statistics were last reset.Date
getNextReapCycle()
Returns the time for the next reap cycle.int
getOverflowAverageSize()
Return the average size (in bytes) of the session attributes stored in the "overflow" clustered cache since the last time statistics were reset or -1 if aSplitHttpSessionCollection
is not in use.String
getOverflowCacheName()
Return the name of the clustered cache that stores the "large attributes" that exceed a certain size and thus are determined to be more efficiently managed as separate cache entries and not as part of the serialized session object itself.int
getOverflowMaxSize()
Return the maximum size (in bytes) of a session attribute stored in the "overflow" clustered cache since the last time statistics were reset or -1 if aSplitHttpSessionCollection
is not in use.int
getOverflowThreshold()
Return the minimum length (in bytes) that the serialized form of an attribute value must be in order for that attribute value to be stored in the separate "overflow" cache that is reserved for large attributes.int
getOverflowUpdates()
Return the number of updates to session attributes stored in the "overflow" clustered cache since the last time statistics were reset or -1 if aSplitHttpSessionCollection
is not in use.long
getReapedSessions()
Returns the number of expired sessions that were reaped in the last reap cycle.long
getReapedSessionsTotal()
Returns the number of expired sessions that has been reaped since the statistics was reset.String
getServletContextCacheName()
Return the name of the clustered cache that stores ServletContext attributes or null if the ServletContext is not clustered.String
getServletContextName()
Return the name of the web application ServletContext.int
getSessionAverageLifetime()
Return the average lifetime (in seconds) of session objects invalidated (either due to expiration or to an explicit invalidation) since the last time statistics were reset.int
getSessionAverageSize()
Return the average size (in bytes) of session objects placed in the session storage clustered cache since the last time statistics were reset.String
getSessionCacheName()
Return the name of the clustered cache that stores serialized session objects.protected SessionHelperFactory
getSessionFactory()
Return the SessionHelper.Factory currently in use.protected SessionHelper
getSessionHelper()
Return the SessionHelper used by this HttpSessionManager object to expose Coherence*Web management attributes and operations.int
getSessionIdLength()
Return the length (in characters) of generated session IDs.int
getSessionMaxSize()
Return the maximum size (in bytes) of a session object placed in the session storage clustered cache since the last time statistics were reset.int
getSessionMinSize()
Return the minimum size (in bytes) of a session object placed in the session storage clustered cache since the last time statistics were reset.int
getSessionStickyCount()
Return the number of session objects that are pinned to this instance of the web application or -1 if sticky session optimizations are disabled.int
getSessionTimeout()
Return the session expiration time (in seconds) or -1 if sessions never expire.int
getSessionUpdates()
Return the number of updates of session object stored in the session storage clustered cache since the last time statistics were reset.protected SplitHttpSessionCollection
getSplitHttpSessionCollection()
Return the SplitHttpSessionCollection currently in use.void
resetStatistics()
Reset the session management statistics.String
toString()
Returns a string representation of the object.-
Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
-
-
-
-
Constructor Detail
-
HttpSessionManager
public HttpSessionManager(SessionHelper helper, SessionReaperStatistics reaperStatistics)
Create a new HttpSessionManager object.- Parameters:
helper
- the SessionHelper for the web application in which Coherence*Web is installedreaperStatistics
- the reaper statistics
-
-
Method Detail
-
getAverageReapQueueWaitDuration
public long getAverageReapQueueWaitDuration()
Return the average number of milliseconds reap tasks wait in the queue prior to running.- Specified by:
getAverageReapQueueWaitDuration
in interfaceHttpSessionManagerMBean
- Returns:
- the average number of milliseconds reap tasks wait in the queue.
-
getAverageReapDuration
public long getAverageReapDuration()
Gets the average reap duration since the statistics was reset.- Specified by:
getAverageReapDuration
in interfaceHttpSessionManagerMBean
- Returns:
- The average reap duration.
-
getAverageReapedSessions
public long getAverageReapedSessions()
Gets the average number of reaped sessions in a reap cycle since the statistics was reset.- Specified by:
getAverageReapedSessions
in interfaceHttpSessionManagerMBean
- Returns:
- The average number of reaped sessions.
-
getCollectionClassName
public String getCollectionClassName()
Return the fully qualified class name of theHttpSessionCollection
implementation in use.- Specified by:
getCollectionClassName
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the CollectionClassName attribute
-
getFactoryClassName
public String getFactoryClassName()
Return the fully qualified class name of theSessionHelperFactory
implementation in use.- Specified by:
getFactoryClassName
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the FactoryClassName attribute
-
getLastReapDuration
public long getLastReapDuration()
Return the time in milliseconds it took for the last reap cycle to finish.- Specified by:
getLastReapDuration
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the LastReapDuration attribute
-
getLastReapQueueWaitDuration
public long getLastReapQueueWaitDuration()
Return the time the last reap task spent in the queue prior to running.- Specified by:
getLastReapQueueWaitDuration
in interfaceHttpSessionManagerMBean
- Returns:
- the time the last reap task spent in the queue prior to running.
-
getLastReapCycle
public Date getLastReapCycle()
Return the start time for the last reap cycle.- Specified by:
getLastReapCycle
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the LastReapTime attribute
-
getLocalAttributeCacheName
public String getLocalAttributeCacheName()
Return the name of the local cache that stores non-distributed session attributes or null if local session attribute storage is disabled.- Specified by:
getLocalAttributeCacheName
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the LocalAttributeCacheName attribute
-
getLocalAttributeCount
public int getLocalAttributeCount()
Return the number of non-distributed session attributes stored in the local session attribute cache or -1 if local session attribute storage is disabled.- Specified by:
getLocalAttributeCount
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the LocalAttributeCount attribute
- See Also:
HttpSessionManagerMBean.getLocalAttributeCacheName()
-
getLocalSessionCacheName
public String getLocalSessionCacheName()
Return the name of the local cache that stores non-distributed sessions or null if local session storage is disabled.- Specified by:
getLocalSessionCacheName
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the LocalSessionCacheName attribute
-
getLocalSessionCount
public int getLocalSessionCount()
Return the number of non-distributed sessions stored in the local session cache or -1 if local session storage is disabled.- Specified by:
getLocalSessionCount
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the LocalSessionCount attribute
- See Also:
HttpSessionManagerMBean.getLocalSessionCacheName()
-
getMaxReapDuration
public long getMaxReapDuration()
Gets the maximum reap duration since the statistics was reset.- Specified by:
getMaxReapDuration
in interfaceHttpSessionManagerMBean
- Returns:
- The max reap duration.
-
getMaxReapQueueWaitDuration
public long getMaxReapQueueWaitDuration()
Return the max time in milliseconds a reap task has spent in the queue prior to running since the statistics were last reset.- Specified by:
getMaxReapQueueWaitDuration
in interfaceHttpSessionManagerMBean
- Returns:
- the max time in milliseconds a reap task has spent in the queue prior to running since the statistics were last reset
-
getMaxReapedSessions
public long getMaxReapedSessions()
Gets the maximum number of sessions reaped in a reap cycle since the statistics was reset.- Specified by:
getMaxReapedSessions
in interfaceHttpSessionManagerMBean
- Returns:
- The max number of sessions reaped.
-
getNextReapCycle
public Date getNextReapCycle()
Returns the time for the next reap cycle.- Specified by:
getNextReapCycle
in interfaceHttpSessionManagerMBean
- Returns:
- the time for the next reap cycle
-
getOverflowAverageSize
public int getOverflowAverageSize()
Return the average size (in bytes) of the session attributes stored in the "overflow" clustered cache since the last time statistics were reset or -1 if aSplitHttpSessionCollection
is not in use.- Specified by:
getOverflowAverageSize
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the OverflowAverageSize attribute
- See Also:
HttpSessionManagerMBean.getCollectionClassName()
,HttpSessionManagerMBean.getOverflowCacheName()
,HttpSessionManagerMBean.getOverflowThreshold()
-
getOverflowCacheName
public String getOverflowCacheName()
Return the name of the clustered cache that stores the "large attributes" that exceed a certain size and thus are determined to be more efficiently managed as separate cache entries and not as part of the serialized session object itself.If a
SplitHttpSessionCollection
is not in use, null is returned.- Specified by:
getOverflowCacheName
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the OverflowCacheName attribute
- See Also:
HttpSessionManagerMBean.getCollectionClassName()
,HttpSessionManagerMBean.getOverflowThreshold()
-
getOverflowMaxSize
public int getOverflowMaxSize()
Return the maximum size (in bytes) of a session attribute stored in the "overflow" clustered cache since the last time statistics were reset or -1 if aSplitHttpSessionCollection
is not in use.- Specified by:
getOverflowMaxSize
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the OverflowMaxSize attribute
- See Also:
HttpSessionManagerMBean.getCollectionClassName()
,HttpSessionManagerMBean.getOverflowCacheName()
,HttpSessionManagerMBean.getOverflowThreshold()
-
getOverflowThreshold
public int getOverflowThreshold()
Return the minimum length (in bytes) that the serialized form of an attribute value must be in order for that attribute value to be stored in the separate "overflow" cache that is reserved for large attributes.If a
SplitHttpSessionCollection
is not in use, -1 is returned.- Specified by:
getOverflowThreshold
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the OverflowThreshold attribute
- See Also:
HttpSessionManagerMBean.getCollectionClassName()
,HttpSessionManagerMBean.getOverflowCacheName()
-
getOverflowUpdates
public int getOverflowUpdates()
Return the number of updates to session attributes stored in the "overflow" clustered cache since the last time statistics were reset or -1 if aSplitHttpSessionCollection
is not in use.- Specified by:
getOverflowUpdates
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the OverflowUpdates attribute
- See Also:
HttpSessionManagerMBean.getCollectionClassName()
,HttpSessionManagerMBean.getOverflowCacheName()
,HttpSessionManagerMBean.getOverflowThreshold()
-
getReapedSessions
public long getReapedSessions()
Returns the number of expired sessions that were reaped in the last reap cycle.- Specified by:
getReapedSessions
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the ReapedSessions attribute
-
getReapedSessionsTotal
public long getReapedSessionsTotal()
Returns the number of expired sessions that has been reaped since the statistics was reset.- Specified by:
getReapedSessionsTotal
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the ReapedSessionsTotal attribute
-
getSessionAverageLifetime
public int getSessionAverageLifetime()
Return the average lifetime (in seconds) of session objects invalidated (either due to expiration or to an explicit invalidation) since the last time statistics were reset.- Specified by:
getSessionAverageLifetime
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the SessionAverageLifetime attribute
-
getSessionAverageSize
public int getSessionAverageSize()
Return the average size (in bytes) of session objects placed in the session storage clustered cache since the last time statistics were reset.- Specified by:
getSessionAverageSize
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the SessionAverageSize attribute
-
getSessionCacheName
public String getSessionCacheName()
Return the name of the clustered cache that stores serialized session objects.- Specified by:
getSessionCacheName
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the SessionCacheName attribute
-
getSessionIdLength
public int getSessionIdLength()
Return the length (in characters) of generated session IDs.- Specified by:
getSessionIdLength
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the SessionIdLength attribute
-
getSessionMaxSize
public int getSessionMaxSize()
Return the maximum size (in bytes) of a session object placed in the session storage clustered cache since the last time statistics were reset.- Specified by:
getSessionMaxSize
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the SessionMaxSize attribute
-
getSessionMinSize
public int getSessionMinSize()
Return the minimum size (in bytes) of a session object placed in the session storage clustered cache since the last time statistics were reset.- Specified by:
getSessionMinSize
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the SessionMinSize attribute
-
getSessionStickyCount
public int getSessionStickyCount()
Return the number of session objects that are pinned to this instance of the web application or -1 if sticky session optimizations are disabled.- Specified by:
getSessionStickyCount
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the SessionStickyCount attribute
-
getSessionTimeout
public int getSessionTimeout()
Return the session expiration time (in seconds) or -1 if sessions never expire.- Specified by:
getSessionTimeout
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the SessionTimeout attribute
-
getSessionUpdates
public int getSessionUpdates()
Return the number of updates of session object stored in the session storage clustered cache since the last time statistics were reset.- Specified by:
getSessionUpdates
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the SessionUpdates attribute
-
getServletContextCacheName
public String getServletContextCacheName()
Return the name of the clustered cache that stores ServletContext attributes or null if the ServletContext is not clustered.- Specified by:
getServletContextCacheName
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the ServletContextCacheName attribute
-
getServletContextName
public String getServletContextName()
Return the name of the web application ServletContext.- Specified by:
getServletContextName
in interfaceHttpSessionManagerMBean
- Returns:
- the value of the ServletContextName attribute
-
resetStatistics
public void resetStatistics()
Reset the session management statistics.- Specified by:
resetStatistics
in interfaceHttpSessionManagerMBean
-
clearStoredConfiguration
public void clearStoredConfiguration()
Removes the stored configuration which is used to check configuration consistency.- Specified by:
clearStoredConfiguration
in interfaceHttpSessionManagerMBean
-
getSessionHelper
protected SessionHelper getSessionHelper()
Return the SessionHelper used by this HttpSessionManager object to expose Coherence*Web management attributes and operations.- Returns:
- the SessionHelper used by this HttpSessionManager
-
getSessionFactory
protected SessionHelperFactory getSessionFactory()
Return the SessionHelper.Factory currently in use.- Returns:
- the SessionHelper.Factory or null if one could not be retrieved
-
getAbstractHttpSessionCollection
protected AbstractHttpSessionCollection getAbstractHttpSessionCollection()
Return the AbstractHttpSessionCollection currently in use.- Returns:
- the AbstractHttpSessionCollection or null if one could not be retrieved
-
getSplitHttpSessionCollection
protected SplitHttpSessionCollection getSplitHttpSessionCollection()
Return the SplitHttpSessionCollection currently in use.- Returns:
- the SplitHttpSessionCollection or null if one could not be retrieved
-
-