Top Fields Constructors Methods
org.eclipse.jetty.session

public abstract Class ObjectStreamSessionDataStore

extends AbstractSessionDataStore
Class Inheritance
Known Direct Subclasses
org.eclipse.jetty.session.JDBCSessionDataStore, org.eclipse.jetty.session.FileSessionDataStore
Imports
java.io.IOException, .InputStream, .ObjectInputStream, .ObjectOutputStream, .OutputStream, java.util.Objects, org.eclipse.jetty.util.ClassLoadingObjectInputStream

Field Summary

Inherited from org.eclipse.jetty.session.AbstractSessionDataStore:
_context_gracePeriodSec_lastExpiryCheckTime_lastOrphanSweepTime_savePeriodSecDEFAULT_GRACE_PERIOD_SECDEFAULT_SAVE_PERIOD_SEC

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
deserializeAttributes(SessionData
the SessionData into which to deserialize the attributes
data
,
InputStream
the InputStream for reading the serialized attributes
is
)

Deserialize the attribute map from the InputStream provided and store into the SessionData.

protected ObjectInputStream

Returns:

an ObjectInputStream that can deserialize the session data
newObjectInputStream
(InputStream
an input stream for accessing the session data to be deserialized
is
)

Get an ObjectInputStream that is capable of deserializing the session data present in the provided InputStream.

public ObjectOutputStream

Returns:

an ObjectOutputStream wrapping the OutputStream
newObjectOutputStream
(OutputStream
an output stream to which to serialize the session data
os
)

Get an ObjectOutputStream suitable to serialize SessionData objects into the provided OutputStream.

protected void
serializeAttributes(SessionData
the SessionData whose attributes are to be serialized
data
,
OutputStream
the OutputStream to receive the serialized attributes
os
)

Serialize the attribute map of the SessionData into the OutputStream provided.

Inherited from org.eclipse.jetty.session.AbstractSessionDataStore:
checkStartedcleanOrphansdoCheckExpireddoCleanOrphansdoExistsdoGetExpireddoLoaddoStartdoStoreexistsgetExpiredgetGracePeriodSecgetSavePeriodSecinitializeloadnewSessionDatasetGracePeriodSecsetSavePeriodSecstoretoString

Constructor Detail

ObjectStreamSessionDataStoreback to summary
public ObjectStreamSessionDataStore()

Method Detail

deserializeAttributesback to summary
protected void deserializeAttributes(SessionData data, InputStream is) throws Exception

Deserialize the attribute map from the InputStream provided and store into the SessionData.

Parameters
data:SessionData

the SessionData into which to deserialize the attributes

is:InputStream

the InputStream for reading the serialized attributes

Exceptions
Exception:
if the attributes cannot be deserialized
newObjectInputStreamback to summary
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:InputStream

an input stream for accessing the session data to be deserialized

Returns:ObjectInputStream

an ObjectInputStream that can deserialize the session data

Exceptions
IOException:
if the stream cannot be created
newObjectOutputStreamback to summary
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:OutputStream

an output stream to which to serialize the session data

Returns:ObjectOutputStream

an ObjectOutputStream wrapping the OutputStream

Exceptions
IOException:
if the stream cannot be created
serializeAttributesback to summary
protected void serializeAttributes(SessionData data, OutputStream os) throws Exception

Serialize the attribute map of the SessionData into the OutputStream provided.

Parameters
data:SessionData

the SessionData whose attributes are to be serialized

os:OutputStream

the OutputStream to receive the serialized attributes

Exceptions
Exception:
if the attributes cannot be serialized