CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.coherence.servlet
Class SplitHttpSessionModel

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.coherence.servlet.AbstractHttpSessionModel
          extended by com.tangosol.coherence.servlet.TraditionalHttpSessionModel
              extended by com.tangosol.coherence.servlet.SplitHttpSessionModel
All Implemented Interfaces:
HttpSessionModel, ExternalizableLite, Externalizable, Serializable

public class SplitHttpSessionModel
extends TraditionalHttpSessionModel

This is an implementation of HttpSessionModel that manages most of its state in a single serializable unit, but splits out its large attributes -- if any -- into separately managed units. By doing so, the cost of accessing those attributes is only realized when they are accessed or modified, and the core session data can remain very small, and thus very efficiently managed in a distributed environment.

Version:
Coherence 2.3
Author:
cp 2003.10.28

Nested Class Summary
 class SplitHttpSessionModel.SplittableHolder
          An immutable object to hold attribute values and related information.
 
Nested classes/interfaces inherited from class com.tangosol.coherence.servlet.TraditionalHttpSessionModel
TraditionalHttpSessionModel.OptimizedHolder
 
Nested classes/interfaces inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionModel
AbstractHttpSessionModel.AttributeHolder
 
Field Summary
 
Fields inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionModel
ENTRY_ARRAY, STRING_ARRAY
 
Constructor Summary
SplitHttpSessionModel()
          Default constructor for deserialization.
SplitHttpSessionModel(SplitHttpSessionCollection collection, HttpSession session, String sId)
          Session creation constructor.
 
Method Summary
 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.
protected  SplitHttpSessionCollection getSplitHttpSessionCollection()
          Get the SplitHttpSessionCollection that contains this model.
protected  AbstractHttpSessionModel.AttributeHolder instantiateAttributeHolder()
          Factory method: Instantiate an AttributeHolder for deserialization purposes.
protected  AbstractHttpSessionModel.AttributeHolder instantiateAttributeHolder(String sName, Object oValue)
          Factory method: Instantiate an AttributeHolder to manage the passed value.
protected  void setCollection(AbstractHttpSessionCollection collection)
          After deserialization, the collection needs to be configured.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionModel
activate, bind, checkActive, checkUsable, checkValid, discard, enter, exit, flush, getActualAttributeMap, getAttribute, getAttributeMap, getAttributeNameArray, getCollection, getCreationTime, getDescription, getHttpSession, getId, getLastAccessedTime, getLastFlushedTime, getLocalAttributeMap, getMaxInactiveInterval, getReferenceCount, isActivatableAttributes, isActive, isExpired, isImmutable, isLocal, isModified, isNew, isOwnedByThisServer, isOwnedByThisThread, isUsable, isValid, logAttributeSerializationFailure, makeDistributed, passivate, readAttributes, readExternal, readExternal, removeAttribute, sessionReturned, setActivatableAttributes, setAttribute, setId, setLastAccessedTime, setLastFlushedTime, setMaxInactiveInterval, setModified, setValid, touch, unbind, unbind, writeAttributes, writeExternal, writeExternal
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 
Methods inherited from interface com.tangosol.io.ExternalizableLite
readExternal, writeExternal
 

Constructor Detail

SplitHttpSessionModel

public SplitHttpSessionModel()
Default constructor for deserialization.


SplitHttpSessionModel

public SplitHttpSessionModel(SplitHttpSessionCollection collection,
                             HttpSession session,
                             String sId)
Session creation constructor.

Parameters:
collection - the collection that manages this model
session - the session that delegates to this model
sId - the session ID
Method Detail

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class TraditionalHttpSessionModel
Returns:
a string representation of the object

setCollection

protected void setCollection(AbstractHttpSessionCollection collection)
After deserialization, the collection needs to be configured.

Overrides:
setCollection in class AbstractHttpSessionModel
Parameters:
collection - the AbstractHttpSessionCollection that this model belongs to

getSplitHttpSessionCollection

protected SplitHttpSessionCollection getSplitHttpSessionCollection()
Get the SplitHttpSessionCollection that contains this model.

Returns:
the SplitHttpSessionCollection that contains this model

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

instantiateAttributeHolder

protected AbstractHttpSessionModel.AttributeHolder instantiateAttributeHolder()
Factory method: Instantiate an AttributeHolder for deserialization purposes.

Overrides:
instantiateAttributeHolder in class TraditionalHttpSessionModel
Returns:
a new AttributeHolder that can be deserialized into

instantiateAttributeHolder

protected AbstractHttpSessionModel.AttributeHolder instantiateAttributeHolder(String sName,
                                                                              Object oValue)
Factory method: Instantiate an AttributeHolder to manage the passed value.

Overrides:
instantiateAttributeHolder in class TraditionalHttpSessionModel
Parameters:
sName - the attribute name
oValue - a non-null Object value
Returns:
a new AttributeHolder that will manage the passed value

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation