org.apache.wicket.serialize.java
Class JavaSerializer

java.lang.Object
  extended by org.apache.wicket.serialize.java.JavaSerializer
All Implemented Interfaces:
ISerializer

public class JavaSerializer
extends Object
implements ISerializer

An implementation of ISerializer based on Java Serialization (ObjectOutputStream, ObjectInputStream) Requires the application key to enable serialization and deserialisation outside thread in which application thread local is set

See Also:
IObjectStreamFactory

Constructor Summary
JavaSerializer(String applicationKey)
          Construct.
 
Method Summary
 Object deserialize(byte[] data)
           
protected  ObjectInputStream newObjectInputStream(InputStream in)
          Gets a new instance of an ObjectInputStream with the provided InputStream.
protected  ObjectOutputStream newObjectOutputStream(OutputStream out)
          Gets a new instance of an ObjectOutputStream with the provided OutputStream.
 byte[] serialize(Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaSerializer

public JavaSerializer(String applicationKey)
Construct.

Parameters:
applicationKey -
Method Detail

serialize

public byte[] serialize(Object object)
Specified by:
serialize in interface ISerializer

deserialize

public Object deserialize(byte[] data)
Specified by:
deserialize in interface ISerializer

newObjectInputStream

protected ObjectInputStream newObjectInputStream(InputStream in)
                                          throws IOException
Gets a new instance of an ObjectInputStream with the provided InputStream.

Parameters:
in - The input stream that should be used for the reading
Returns:
a new object input stream instance
Throws:
IOException - if an I/O error occurs while reading stream header

newObjectOutputStream

protected ObjectOutputStream newObjectOutputStream(OutputStream out)
                                            throws IOException
Gets a new instance of an ObjectOutputStream with the provided OutputStream.

Parameters:
out - The output stream that should be used for the writing
Returns:
a new object output stream instance
Throws:
IOException - if an I/O error occurs while writing stream header


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.