Package org.eclipse.jetty.session
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
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
- Direct Known Subclasses:
FileSessionDataStore
,JDBCSessionDataStore
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
Fields inherited from class org.eclipse.jetty.session.AbstractSessionDataStore
_context, _gracePeriodSec, _lastExpiryCheckTime, _lastOrphanSweepTime, _savePeriodSec, DEFAULT_GRACE_PERIOD_SEC, DEFAULT_SAVE_PERIOD_SEC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
deserializeAttributes
(SessionData data, InputStream is) Deserialize the attribute map from the InputStream provided and store into the SessionData.protected ObjectInputStream
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
serializeAttributes
(SessionData data, OutputStream os) Serialize the attribute map of the SessionData into the OutputStream provided.Methods inherited from class org.eclipse.jetty.session.AbstractSessionDataStore
checkStarted, cleanOrphans, doCheckExpired, doCleanOrphans, doExists, doGetExpired, doLoad, doStart, doStore, exists, getExpired, getGracePeriodSec, getSavePeriodSec, initialize, load, newSessionData, setGracePeriodSec, setSavePeriodSec, store, toString
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, installBean, installBean, 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.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
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
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
Serialize the attribute map of the SessionData into the OutputStream provided.- Parameters:
data
- the SessionData whose attributes are to be serializedos
- the OutputStream to receive the serialized attributes- Throws:
Exception
- if the attributes cannot be serialized
-
deserializeAttributes
Deserialize the attribute map from the InputStream provided and store into the SessionData.- Parameters:
data
- the SessionData into which to deserialize the attributesis
- the InputStream for reading the serialized attributes- Throws:
Exception
- if the attributes cannot be deserialized
-