Package com.sun.faces.spi
Interface SerializationProvider
-
public interface SerializationProviderThis 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectInputStreamcreateObjectInputStream(InputStream source)Creates a newObjectInputStreamwrapping the specifiedsource.ObjectOutputStreamcreateObjectOutputStream(OutputStream destination)Creates a newObjectOutputStreamwrapping the specifieddestination.
-
-
-
Method Detail
-
createObjectInputStream
ObjectInputStream createObjectInputStream(InputStream source) throws IOException
Creates a newObjectInputStreamwrapping the specifiedsource.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- the source stream from which to read the Object(s) from- Returns:
- an
ObjectInputStream - Throws:
IOException- if an error occurs when creating the input stream
-
createObjectOutputStream
ObjectOutputStream createObjectOutputStream(OutputStream destination) throws IOException
Creates a newObjectOutputStreamwrapping the specifieddestination.- Parameters:
destination- the destination of the serialized Object(s)- Returns:
- an
ObjectOutputStream - Throws:
IOException- if an error occurs when creating the output stream
-
-