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

com.tangosol.coherence.servlet
Class SplitHttpSessionCollection

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.coherence.servlet.AbstractHttpSessionCollection
          extended by com.tangosol.coherence.servlet.TraditionalHttpSessionCollection
              extended by com.tangosol.coherence.servlet.SplitHttpSessionCollection
All Implemented Interfaces:
HttpSessionCollection, XmlConfigurable

public class SplitHttpSessionCollection
extends TraditionalHttpSessionCollection

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:

Version:
Coherence 2.3
Author:
cp 2003.08.20

Nested Class Summary
 
Nested classes/interfaces inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionCollection
AbstractHttpSessionCollection.ExitAgent, AbstractHttpSessionCollection.ExitObserver, AbstractHttpSessionCollection.SimpleDistributedController, AbstractHttpSessionCollection.SimpleHybridController, AbstractHttpSessionCollection.SimpleLocalController
 
Nested classes/interfaces inherited from interface com.tangosol.coherence.servlet.HttpSessionCollection
HttpSessionCollection.SessionDistributionController
 
Field Summary
static String CACHENAME_OVERFLOW
          The name of the clustered cache that stores the attributes that are too large to store as part of the session objects.
static String 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").
static String 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.
 
Fields inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionCollection
CACHENAME_DEATHCERTS, CACHENAME_LOCAL_ATTRIBUTES, CACHENAME_LOCAL_SESSIONS, CACHENAME_SESSIONS, CTX_INIT_ALLOW_LOCAL_ATTRIBUTES, CTX_INIT_CACHENAME_DEATHCERTS, CTX_INIT_CACHENAME_LOCAL_ATTRIBUTES, CTX_INIT_CACHENAME_LOCAL_SESSIONS, CTX_INIT_CACHENAME_SESSIONS, CTX_INIT_CONTROLLER_CLASS, CTX_INIT_DAEMON_ASSUME_LOCALITY, CTX_INIT_SERVICENAME_OWNERSHIP, CTX_INIT_SESSION_EXPIRE_SECS, CTX_INIT_SESSION_ID_LENGTH, CTX_INIT_SESSION_STICKY, CTX_INIT_SESSION_STRICT_SPEC, CTX_INIT_SESSION_THREAD_LOCK, SERVICENAME_OWNERSHIP
 
Constructor Summary
SplitHttpSessionCollection()
          Default constructor (required).
 
Method Summary
 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.
 NamedCache getExternalAttributeCache()
          Obtain the cache used to store the large session attributes.
 int getExternalAttributeUpdates()
          Return the number of updates to session attributes stored in the external attribute cache since the last time statistics were reset.
 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.
 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  AbstractHttpSessionModel instantiateModel(HttpSession session, String sId)
          Factory Method: Instantiate a AbstractHttpSessionModel or subclass thereof.
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.
 void resetStatistics()
          Reset all statistics maintained by this session collection.
 void setConfig(XmlElement xml)
          Specify the configuration for the object.
 void shutdown()
          Notify the session collection that it is being shut down.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class com.tangosol.coherence.servlet.AbstractHttpSessionCollection
activate, addHttpSessionAttributeListener, addHttpSessionListener, create, destroy, destroyLocalAttributesCache, ensureLocalAttributesCache, enter, exit, flush, generateSessionId, get, getAverageModelLifetime, getAverageModelSize, getClusterCache, getCollection, getConfig, getCurrentTime, getDeathCertCache, getDefaultMaxInactiveInterval, getDescription, getDistributionController, getHttpSessionAttributeListeners, getHttpSessionListeners, getLocalAttributesCache, getLocalCache, getMaxModelSize, getMinModelSize, getModel, getModelDeaths, getModelUpdates, getOwnedCache, getOwnedModel, getSessionIdLength, getStickyCache, getStickyService, isActive, isAllowLocalAttributes, isAssumeLocality, isExistent, isModelSingleThreaded, isOwned, isOwnershipSticky, isStrict, isStuck, iterateIds, iterateLocalIds, obtainClusterOwnership, onModelUpdate, passivate, postCreate, putBlind, releaseCache, releaseClusterOwnership, releaseStuckSession, removeBlind, removeHttpSessionAttributeListener, removeHttpSessionListener
 

Field Detail

CTX_INIT_CACHENAME_OVERFLOW

public static final String 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:
Constant Field Values

CTX_INIT_ATTR_OVERFLOW_THRESHOLD

public static final String 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:
Constant Field Values

CACHENAME_OVERFLOW

public static final String 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:
Constant Field Values
Constructor Detail

SplitHttpSessionCollection

public SplitHttpSessionCollection()
Default constructor (required).

Method Detail

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:
shutdown in interface HttpSessionCollection
Overrides:
shutdown in class AbstractHttpSessionCollection

setConfig

public void setConfig(XmlElement xml)
Specify the configuration for the object.

Specified by:
setConfig in interface XmlConfigurable
Overrides:
setConfig in class AbstractHttpSessionCollection
Parameters:
xml - the XML configuration for the object
Throws:
IllegalStateException - if the object is not in a state that allows the configuration to be set; for example, if the object has already been configured and cannot be reconfigured

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

public NamedCache getExternalAttributeCache()
Obtain the cache used to store the large session attributes.

Returns:
the external cache used to store large session attributes

toString

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

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

instantiateModel

protected AbstractHttpSessionModel instantiateModel(HttpSession session,
                                                    String sId)
Factory Method: Instantiate a AbstractHttpSessionModel or subclass thereof.

Overrides:
instantiateModel in class TraditionalHttpSessionCollection
Parameters:
session - the session that delegates to this model
sId - 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:
resetStatistics in class AbstractHttpSessionCollection

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

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