Class ObjectStreamSessionDataStore

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.session.AbstractSessionDataStore
org.eclipse.jetty.session.ObjectStreamSessionDataStore
All Implemented Interfaces:
SessionDataMap, SessionDataStore, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle
Direct Known Subclasses:
FileSessionDataStore, JDBCSessionDataStore

public abstract class ObjectStreamSessionDataStore extends AbstractSessionDataStore
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Deserialize the attribute map from the InputStream provided and store into the SessionData.
    Get an ObjectInputStream that is capable of deserializing the session data present in the provided InputStream.
    Get an ObjectOutputStream suitable to serialize SessionData objects into the provided OutputStream.
    protected void
    Serialize the attribute map of the SessionData into the OutputStream provided.

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable

    Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

    addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop

    Methods inherited from interface org.eclipse.jetty.session.SessionDataMap

    delete

    Methods inherited from interface org.eclipse.jetty.session.SessionDataStore

    isPassivating
  • Constructor Details

    • ObjectStreamSessionDataStore

      public ObjectStreamSessionDataStore()
  • Method Details

    • newObjectOutputStream

      public ObjectOutputStream newObjectOutputStream(OutputStream os) throws IOException
      Get an ObjectOutputStream suitable to serialize SessionData objects into the provided OutputStream.
      By default, an ObjectObjectStream is returned.
      Override this method to provide a custom ObjectOutputStream, and/or to chain other OutputStreams to perform such tasks as compressing the serialized data, for example:
      GZIPOutputStream gos = new GZIPOutputStream(os); return new ObjectOutputStream(gos);
      Parameters:
      os - an output stream to which to serialize the session data
      Returns:
      an ObjectOutputStream wrapping the OutputStream
      Throws:
      IOException - if the stream cannot be created
    • newObjectInputStream

      protected ObjectInputStream newObjectInputStream(InputStream is) throws IOException
      Get an ObjectInputStream that is capable of deserializing the session data present in the provided InputStream.
      By default, a Classloader-aware ObjectInputStream is used, however, you can return your own specialized ObjectInputStream, or chain other InputStreams together to perform such tasks as data decompression, for example:
      GZIPInputStream gis = new GZIPInputStream(is); return new ClassLoadingObjectInputStream(is)
      Parameters:
      is - an input stream for accessing the session data to be deserialized
      Returns:
      an ObjectInputStream that can deserialize the session data
      Throws:
      IOException - if the stream cannot be created
    • serializeAttributes

      protected void serializeAttributes(SessionData data, OutputStream os) throws Exception
      Serialize the attribute map of the SessionData into the OutputStream provided.
      Parameters:
      data - the SessionData whose attributes are to be serialized
      os - the OutputStream to receive the serialized attributes
      Throws:
      Exception - if the attributes cannot be serialized
    • deserializeAttributes

      protected void deserializeAttributes(SessionData data, InputStream is) throws Exception
      Deserialize the attribute map from the InputStream provided and store into the SessionData.
      Parameters:
      data - the SessionData into which to deserialize the attributes
      is - the InputStream for reading the serialized attributes
      Throws:
      Exception - if the attributes cannot be deserialized