Class SplitHttpSessionCollection

  • All Implemented Interfaces:
    CoherenceHttpSessionCollection, HttpSessionCollection

    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:

    • "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
    • 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
      • CTX_INIT_ATTR_OVERFLOW_THRESHOLD_DEFAULT

        public static final int CTX_INIT_ATTR_OVERFLOW_THRESHOLD_DEFAULT
        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
      • 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
      • getMultiExternalAttributeMap

        public Map<Object,​Set<SplitHttpSessionModel.ElasticKey>> 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
      • instantiateModel

        protected AbstractHttpSessionModel instantiateModel​(javax.servlet.http.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
      • 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