Package com.tangosol.coherence.servlet
Class MonolithicHttpSessionModel
java.lang.Object
com.tangosol.util.Base
com.tangosol.coherence.servlet.AbstractHttpSessionModel
com.tangosol.coherence.servlet.MonolithicHttpSessionModel
- All Implemented Interfaces:
HttpSessionModel,ExternalizableLite,Externalizable,Serializable
This is an implementation of HttpSessionModel that manages its attribute
state in a single ('monolithic') serializable unit, allowing session
attributes to safely form graphs while avoiding duplication of objects, yet
not being able to optimize attribute serialization and deserialization as a
result.
- Version:
- Coherence 2.5
- Author:
- cp 2004.08.16
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter -
Field Summary
Fields inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionModel
CTX_OPTIMIZE_MODIFIED_SESSIONS, MAGIC_V350, STRING_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for deserialization.MonolithicHttpSessionModel(MonolithicHttpSessionCollection collection, javax.servlet.http.HttpSession session, String sId) Session creation constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected MapEnsure that the map of attributes that cannot be written exists, creating it if necessary, and return it.protected voidenter()Increment the usage count of the session by this thread.protected voidSpecify that the attributes are now being written.protected MapGet the map of attributes that cannot be written.protected booleanDetermine if the attributes are currently being written.protected voidSpecify that the attributes are no longer being written.protected voidLog a serialization failure for an attribute holder.protected voidHelper to read the session attributes from a stream.protected voidsetAttributeSerializationFailureMap(Map mapFailures) Set the map of attributes that cannot be written.toString()Returns a string representation of the object.protected voidHelper to write the session attributes to a stream.Methods inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionModel
activate, addEnteredThread, bind, checkActive, checkUsable, checkValid, discard, exit, extractAttributeName, extractAttributeNames, flush, getActualAttributeMap, getAttribute, getAttributeMap, getAttributeNameArray, getCollection, getCreationTime, getDescription, getEnteredThreads, getHttpSession, getId, getLastAccessedTime, getLastFlushedTime, getLocalAttributeMap, getMaxInactiveInterval, getNewId, getReferenceCount, getThreadOwner, getVersion, instantiateAttributeHolder, instantiateAttributeHolder, isActivatableAttributes, isActive, isExpired, isExpiredInternal, isImmutable, isLastAccessTimeFlushRequired, isLocal, isModified, isNew, isOwnedByThisThread, isUsable, isValid, obtainThreadOwnership, passivate, qualifyAttributeName, readExternal, readExternal, releaseThreadOwnership, removeAttribute, removeEnteredThread, resetReferenceCount, sessionReturned, setActivatableAttributes, setAttribute, setCollection, setHttpSession, setId, setLastAccessedTime, setLastFlushedTime, setMaxInactiveInterval, setModified, setNewId, setValid, setVersion, touch, unbind, unbind, writeExternal, writeExternalMethods 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
-
Constructor Details
-
MonolithicHttpSessionModel
public MonolithicHttpSessionModel()Default constructor for deserialization. -
MonolithicHttpSessionModel
public MonolithicHttpSessionModel(MonolithicHttpSessionCollection collection, javax.servlet.http.HttpSession session, String sId) Session creation constructor.- Parameters:
collection- the collection that manages this modelsession- the session that delegates to this modelsId- the session ID
-
-
Method Details
-
readAttributes
Helper to read the session attributes from a stream.- Overrides:
readAttributesin classAbstractHttpSessionModel- Parameters:
in- the stream to read data from in order to restore the object- Throws:
IOException- if an I/O exception occurs
-
writeAttributes
Helper to write the session attributes to a stream.- Overrides:
writeAttributesin classAbstractHttpSessionModel- Parameters:
out- the stream to write the object to- Throws:
IOException- if an I/O exception occurs
-
enterWriteAttributes
protected void enterWriteAttributes()Specify that the attributes are now being written. -
leaveWriteAttributes
protected void leaveWriteAttributes()Specify that the attributes are no longer being written. -
isWritingAttributes
protected boolean isWritingAttributes()Determine if the attributes are currently being written.- Returns:
- true if the
writeAttributes(java.io.DataOutput)processing is occurring
-
getAttributeSerializationFailureMap
Get the map of attributes that cannot be written. This map should only exist during attribute serialization, and only if failures occur.- Returns:
- a map of currently accumulating unserializable attributes, or null
-
setAttributeSerializationFailureMap
Set the map of attributes that cannot be written. This map should only exist during attribute serialization, and only if failures occur.- Parameters:
mapFailures- the map
-
ensureAttributeSerializationFailureMap
Ensure that the map of attributes that cannot be written exists, creating it if necessary, and return it.- Returns:
- a map of currently accumulating unserializable attributes; never null
-
logAttributeSerializationFailure
Log a serialization failure for an attribute holder.- Overrides:
logAttributeSerializationFailurein classAbstractHttpSessionModel- Parameters:
holder- the attribute holder that failed to serialize its valuee- the throwable object that resulted from the serialization failure
-
enter
protected void enter()Description copied from class:AbstractHttpSessionModelIncrement the usage count of the session by this thread.This method may only be called by a thread that owns this model. See
AbstractHttpSessionCollection.obtainThreadOwnership(java.lang.String).- Overrides:
enterin classAbstractHttpSessionModel
-
toString
Returns a string representation of the object.- Overrides:
toStringin classAbstractHttpSessionModel- Returns:
- a string representation of the object
-