Top Description Methods
com.sun.faces.spi

public Interface SerializationProvider

Known Direct Implementers
com.sun.faces.spi.SerializationProviderFactory.JavaSerializationProvider
Imports
java.io.ObjectInputStream, .InputStream, .ObjectOutputStream, .OutputStream, .IOException

This interface provides a mechanism to allow the use of alternate Java Serialization implementations.

The implementation of this interface *must* be thread-safe and must have a no-arg constructor.

Method Summary

Modifier and TypeMethod and Description
public ObjectInputStream

Returns:

an ObjectInputStream
createObjectInputStream
(InputStream
the source stream from which to read the Object(s) from
source
)

Creates a new ObjectInputStream wrapping the specified source.

public ObjectOutputStream

Returns:

an ObjectOutputStream
createObjectOutputStream
(OutputStream
the destination of the serialized Object(s)
destination
)

Creates a new ObjectOutputStream wrapping the specified destination.

Method Detail

createObjectInputStreamback to summary
public ObjectInputStream createObjectInputStream(InputStream source) throws IOException

Creates a new ObjectInputStream wrapping the specified source.

It's extremely important that the ObjectInputStream returned by this method extends the serialization implementation's ObjectInputStream and overrides the ObjectInputStream#resolveClass(java.io.ObjectStreamClass) of to perform the following or the equivalent thereof:

    return Class.forName(desc.getName(),true, 
               Thread.currentThread().getContextClassLoader());

If this step isn't done, there may be problems when deserializing.

Parameters
source:InputStream

the source stream from which to read the Object(s) from

Returns:ObjectInputStream

an ObjectInputStream

Exceptions
IOException:
if an error occurs when creating the input stream
createObjectOutputStreamback to summary
public ObjectOutputStream createObjectOutputStream(OutputStream destination) throws IOException

Creates a new ObjectOutputStream wrapping the specified destination.

Parameters
destination:OutputStream

the destination of the serialized Object(s)

Returns:ObjectOutputStream

an ObjectOutputStream

Exceptions
IOException:
if an error occurs when creating the output stream