org.apache.openjpa.util
Class Serialization

java.lang.Object
  extended by org.apache.openjpa.util.Serialization

public class Serialization
extends Object

Helper class to serialize and deserialize persistent objects, subtituting oids into the serialized stream and subtituting the persistent objects back during deserialization.

Since:
0.3.3
Author:
Abe White

Nested Class Summary
static class Serialization.ClassResolvingObjectInputStream
           
static class Serialization.PersistentObjectInputStream
          Object input stream that replaces oids with their objects.
static class Serialization.PersistentObjectOutputStream
          Object output stream that replaces persistent objects with their oids.
 
Constructor Summary
Serialization()
           
 
Method Summary
static Object deserialize(byte[] bytes, StoreContext ctx)
          Deserialize an object value from the given bytes.
static Object deserialize(InputStream in, StoreContext ctx)
          Deserialize an object value from the given stream.
static byte[] serialize(Object val, StoreContext ctx)
          Serialize a value that might contain persistent objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Serialization

public Serialization()
Method Detail

serialize

public static byte[] serialize(Object val,
                               StoreContext ctx)
Serialize a value that might contain persistent objects. Replaces persistent objects with their oids.


deserialize

public static Object deserialize(byte[] bytes,
                                 StoreContext ctx)
Deserialize an object value from the given bytes.


deserialize

public static Object deserialize(InputStream in,
                                 StoreContext ctx)
Deserialize an object value from the given stream.



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