Class MonolithicHttpSessionModel

All Implemented Interfaces:
HttpSessionModel, ExternalizableLite, Externalizable, Serializable

public class MonolithicHttpSessionModel extends AbstractHttpSessionModel
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:
  • 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 model
      session - the session that delegates to this model
      sId - the session ID
  • Method Details

    • readAttributes

      protected void readAttributes(DataInput in) throws IOException
      Helper to read the session attributes from a stream.
      Overrides:
      readAttributes in class AbstractHttpSessionModel
      Parameters:
      in - the stream to read data from in order to restore the object
      Throws:
      IOException - if an I/O exception occurs
    • writeAttributes

      protected void writeAttributes(DataOutput out) throws IOException
      Helper to write the session attributes to a stream.
      Overrides:
      writeAttributes in class AbstractHttpSessionModel
      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

      protected Map 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

      protected void setAttributeSerializationFailureMap(Map mapFailures)
      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

      protected 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

      protected void logAttributeSerializationFailure(AttributeHolder holder, Throwable e)
      Log a serialization failure for an attribute holder.
      Overrides:
      logAttributeSerializationFailure in class AbstractHttpSessionModel
      Parameters:
      holder - the attribute holder that failed to serialize its value
      e - the throwable object that resulted from the serialization failure
    • enter

      protected void enter()
      Description copied from class: AbstractHttpSessionModel
      Increment 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:
      enter in class AbstractHttpSessionModel
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class AbstractHttpSessionModel
      Returns:
      a string representation of the object