Package com.tangosol.coherence.servlet
Class SplitHttpSessionCollection
java.lang.Object
com.tangosol.util.Base
com.tangosol.coherence.servlet.AbstractHttpSessionCollection
com.tangosol.coherence.servlet.TraditionalHttpSessionCollection
com.tangosol.coherence.servlet.SplitHttpSessionCollection
- All Implemented Interfaces:
CoherenceHttpSessionCollection,HttpSessionCollection
An implementation of HttpSessionCollection that manages session objects
as multiple units, splitting out larger session attributes into separately
managed entries.
The collection uses three configurable named caches to manage its session information in the cluster:
- "session-storage": (See the documentation for the TraditionalHttpSessionCollection.)
- "session-overflow": This cache is used to manage the session attributes that are large enough to warrant being "split out" from the core session data.
- Version:
- Coherence 2.3
- Author:
- cp 2003.08.20
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionCollection
AbstractHttpSessionCollection.ApplicationScopeController, AbstractHttpSessionCollection.DistributedController, AbstractHttpSessionCollection.GlobalScopeController, AbstractHttpSessionCollection.HybridController, AbstractHttpSessionCollection.LocalControllerNested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriterNested classes/interfaces inherited from interface com.tangosol.coherence.servlet.HttpSessionCollection
HttpSessionCollection.AttributeScopeController, HttpSessionCollection.SessionDistributionController -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the clustered cache that stores the attributes that are too large to store as part of the session objects.static final StringThe configuration property for the "split" model that overrides the length that attributes must be below to be stored inside a session ("embedded") or above which they will be stored in the separated "overflow" cache ("external").static final intstatic final StringThe configuration property that overrides the name of the clustered cache that stores the "overflowing" (split-out due to size) session attributes.Fields inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionCollection
CACHENAME_LOCAL_ATTRIBUTES, CACHENAME_LOCAL_SESSIONS, CACHENAME_SESSIONS, CTX_INIT_ENABLE_SESSION_ACCESS_DEBUG_LOGGING, CTX_INIT_SESSION_ACCESS_DEBUG_LOGGING_FILTER, f_mapLocks, SERVICENAME_OWNERSHIP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(XmlElement xml, SessionHelper sessionHelper) Configure the session collection using the xml document.Deletes the locally opened sessions in the session-cache which have timed out, using an EntryProcessor and return the ids of the deleted sessions.Delete the sessions in the session-cache which have timed out, using an EntryProcessor and return the ids of deleted sessions.intCalculate the average size (in bytes) of the session attributes stored in the external attribute cache since the last time statistics were reset.Obtain the cache used to store the large session attributes.intReturn the number of updates to session attributes stored in the external attribute cache since the last time statistics were reset.intReturn the maximum size (in bytes) of a session attribute stored in the external attribute cache since the last time statistics were reset.intDetermine the minimum size of an attribute such that it is considered "large" and will be stored in a separate "external" or "overflow" cache.Obtain the map of session key to segment keys of large session attributes that exceeds 64M.protected AbstractHttpSessionModelinstantiateModel(javax.servlet.http.HttpSession session, String sId) Factory Method: Instantiate a AbstractHttpSessionModel or subclass thereof.protected voidonExternalAttributeUpdate(int cb) Notify the session collection that an attribute of the specified size (in bytes) was updated in the external attribute cache.voidReset all statistics maintained by this session collection.voidshutdown()Notify the session collection that it is being shut down.toString()Returns a string representation of the object.Methods inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionCollection
activate, addHttpSessionAttributeListener, addHttpSessionListener, cleanUpDeletedSessions, clearClusterCache, create, create, deleteModelFromLocalCaches, destroy, destroyLocalAttributesCache, ensureClusterCache, ensureLocalAttributesCache, enter, enter, exit, exit, fireSessionDestroyedListeners, generateSessionId, get, getActiveCache, getAppControlCache, getAverageModelLifetime, getAverageModelSize, getCacheDelegator, getClusterCache, getCollection, getConfig, getCurrentTime, getDefaultMaxInactiveInterval, getDescription, getDistributionController, getHttpSessionAttributeListeners, getHttpSessionCollectionConfiguration, getHttpSessionListeners, getLocalAttributesCache, getLocalCache, getLocalCacheName, getLocalSessionIds, getLocalSessonIdsSnapshot, getMaxModelSize, getMinModelSize, getModel, getModel, getModelDeaths, getModelUpdates, getOwnedCache, getOwnedModel, getScopeController, getSerializer, getSessionAccessDebugLoggingFilter, getSessionExpiryFilter, getSessionIdGenerator, getSessionIdLength, getSessionOwnershipInfo, getStickyCache, getStickyExitTaskCache, getStickyService, isActive, isAllowLocalAttributes, isAppLockingEnforced, isAssumeLocality, isEnableAttributeListenerOptimization, isEnabledSessionAccessDebugLogging, isEnableSuspectAttributes, isExistent, isMemberLockingEnforced, isOwned, isOwnershipSticky, isSessionLockingEnforced, isStrict, isStuck, isThreadLockingEnforced, iterateIds, iteratePotentiallyExpiredIds, iteratePotentiallyExpiredLocalIds, logInvalidationExceptions, obtainAppOwnership, obtainClusterOwnership, obtainThreadOwnership, onModelUpdate, passivate, postCreate, putBlind, recordMapLocksState, releaseAppOwnership, releaseCache, releaseClusterOwnership, releaseStuckSession, releaseThreadOwnership, remapSessionId, removeAllBlind, removeBlind, removeHttpSessionAttributeListener, removeHttpSessionListener, removeMapLocksState, setCacheDelegator, setConfiguration, setSerializer, updateSessionStatiticsMethods 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, newHashMap, newHashMap, newHashSet, newHashSet, 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
-
Field Details
-
CTX_INIT_CACHENAME_OVERFLOW
The configuration property that overrides the name of the clustered cache that stores the "overflowing" (split-out due to size) session attributes. Only used for the "Split" model.- See Also:
-
CTX_INIT_ATTR_OVERFLOW_THRESHOLD
The configuration property for the "split" model that overrides the length that attributes must be below to be stored inside a session ("embedded") or above which they will be stored in the separated "overflow" cache ("external").- See Also:
-
CACHENAME_OVERFLOW
The name of the clustered cache that stores the attributes that are too large to store as part of the session objects.- See Also:
-
CTX_INIT_ATTR_OVERFLOW_THRESHOLD_DEFAULT
public static final int CTX_INIT_ATTR_OVERFLOW_THRESHOLD_DEFAULT- See Also:
-
-
Constructor Details
-
SplitHttpSessionCollection
public SplitHttpSessionCollection()Default constructor (required).
-
-
Method Details
-
shutdown
public void shutdown()Notify the session collection that it is being shut down. After this method invocation has been made, the session collection may throw IllegalStateException for any subsequent method invocation made to it.- Specified by:
shutdownin interfaceHttpSessionCollection- Overrides:
shutdownin classAbstractHttpSessionCollection
-
configure
Configure the session collection using the xml document.- Specified by:
configurein interfaceCoherenceHttpSessionCollection- Overrides:
configurein classAbstractHttpSessionCollection- Parameters:
xml- the xml elementsessionHelper- the session helper
-
getMinExternalAttributeSize
public int getMinExternalAttributeSize()Determine the minimum size of an attribute such that it is considered "large" and will be stored in a separate "external" or "overflow" cache.- Returns:
- the length of attributes, above which they will be stored in the external ("overflow") cache
-
getExternalAttributeCache
Obtain the cache used to store the large session attributes.- Returns:
- the external cache used to store large session attributes
-
getMultiExternalAttributeMap
Obtain the map of session key to segment keys of large session attributes that exceeds 64M.- Returns:
- the map of session key to segment keys of large session attributes
- Since:
- 12.2.1.4.16
-
toString
Returns a string representation of the object.- Overrides:
toStringin classTraditionalHttpSessionCollection- Returns:
- a string representation of the object
-
instantiateModel
protected AbstractHttpSessionModel instantiateModel(javax.servlet.http.HttpSession session, String sId) Factory Method: Instantiate a AbstractHttpSessionModel or subclass thereof.- Overrides:
instantiateModelin classTraditionalHttpSessionCollection- Parameters:
session- the session that delegates to this modelsId- the session ID- Returns:
- a new instance of AbstractHttpSessionModel or subclass thereof
-
getAverageExternalAttributeSize
public int getAverageExternalAttributeSize()Calculate the average size (in bytes) of the session attributes stored in the external attribute cache since the last time statistics were reset.- Returns:
- the average external attribute size (in bytes)
-
getMaxExternalAttributeSize
public int getMaxExternalAttributeSize()Return the maximum size (in bytes) of a session attribute stored in the external attribute cache since the last time statistics were reset.- Returns:
- the maximum external attribute size (in bytes)
-
getExternalAttributeUpdates
public int getExternalAttributeUpdates()Return the number of updates to session attributes stored in the external attribute cache since the last time statistics were reset.- Returns:
- the number of updates to the external attribute cache
-
resetStatistics
public void resetStatistics()Reset all statistics maintained by this session collection.- Overrides:
resetStatisticsin classAbstractHttpSessionCollection
-
onExternalAttributeUpdate
protected void onExternalAttributeUpdate(int cb) Notify the session collection that an attribute of the specified size (in bytes) was updated in the external attribute cache.- Parameters:
cb- the size (in bytes) of the external attribute
-
deleteExpiredSessions
Delete the sessions in the session-cache which have timed out, using an EntryProcessor and return the ids of deleted sessions.- Specified by:
deleteExpiredSessionsin interfaceHttpSessionCollection- Overrides:
deleteExpiredSessionsin classAbstractHttpSessionCollection- Returns:
- the set of ids of sessions that are deleted
-
deleteExpiredLocalSessions
Deletes the locally opened sessions in the session-cache which have timed out, using an EntryProcessor and return the ids of the deleted sessions.- Specified by:
deleteExpiredLocalSessionsin interfaceHttpSessionCollection- Overrides:
deleteExpiredLocalSessionsin classAbstractHttpSessionCollection- Returns:
- the set of ids of sessions that are deleted
-