Class 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
    See Also:
    Serialized Form
    • Field Detail

      • SESSION_ID_EXTRACTOR

        public static ValueExtractor SESSION_ID_EXTRACTOR
        ValueExtractor that can be used to extract the session ID from an external attribute key.
      • s_mapElastic

        protected static final Map<String,​Integer> s_mapElastic
        The map of cache and its max value size if using elastic data. For cache that doesn't use elastic data, the max value size is 0.
    • Constructor Detail

      • SplitHttpSessionModel

        public SplitHttpSessionModel()
        Default constructor for deserialization.
      • SplitHttpSessionModel

        public SplitHttpSessionModel​(SplitHttpSessionCollection collection,
                                     javax.servlet.http.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

      • getSplitHttpSessionCollection

        protected SplitHttpSessionCollection getSplitHttpSessionCollection()
        Get the SplitHttpSessionCollection that contains this model.
        Returns:
        the SplitHttpSessionCollection that contains this model
      • removeExternalAttributes

        protected void removeExternalAttributes()
        Helper method used to forcefully remove all external attributes from the external attribute cache.
      • setExternalBinary

        protected void setExternalBinary​(Object oKey,
                                         Binary binValue)
        Adds this binary value to the temporary map for flushing.
        Parameters:
        oKey - The attribute name
        binValue - The binary value
      • removeExternalAttribute

        protected void removeExternalAttribute​(Object oKey)
        Removes an external attribute from the external cache.
        Parameters:
        oKey - the key
      • 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
      • getExternalCache

        protected NamedCache getExternalCache()
        Obtain the cache that holds split-out (external) attribute values.
        Returns:
        the cache that holds split-out (external) attribute values
      • getMultiExternalMap

        protected Map<Object,​Set<SplitHttpSessionModel.ElasticKey>> getMultiExternalMap()
        Obtain the caches that hold segments of large (external) attribute value.
        Returns:
        the caches that hold segments of large (external) attribute value
        Since:
        12.2.1.4.16
      • remapExternalAttributes

        protected void remapExternalAttributes​(String sIdNew)
        Copy all attributes which are stored in an external cache so that the attribute key reflects the new session id.
        Parameters:
        sIdNew - the new session id
      • instantiateAttributeHolder

        protected 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