goodslib
Class ObjectClosure
java.lang.Object
goodsjpi.Persistent
goodslib.ObjectClosure
- All Implemented Interfaces:
- java.io.Serializable
- public class ObjectClosure
- extends Persistent
This class can be used to save in persistent storage cluster of
transient Java objects using serialization mecahnism. Class
java.io.ObjectOutputStream is used to pack all objects reachable from
some specified root object into stream of bytes. Data is stored in
GOODS persistent object as array of bytes. It can be restored lately
by java.io.ObjectInputStream (classes of all packed objects should be
available in application).
- See Also:
- Serialized Form
Field Summary |
protected byte[] |
buf
|
Constructor Summary |
ObjectClosure(java.lang.Object root)
Create new instance of object closure given specified root object. |
Method Summary |
java.lang.Object |
extract()
Extract objects from object closure and returns reference to root object
and return reference to root object. |
void |
store(java.lang.Object root)
Pack objects into array of bytes to be placed in storage.
|
Methods inherited from class java.lang.Object |
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
buf
protected byte[] buf
ObjectClosure
public ObjectClosure(java.lang.Object root)
- Create new instance of object closure given specified root object.
store
public void store(java.lang.Object root)
- Pack objects into array of bytes to be placed in storage.
All objects accessible by refernces from root objects will be placed
in this object closure.
extract
public java.lang.Object extract()
- Extract objects from object closure and returns reference to root object
and return reference to root object. After been extracted from the
closure, these objects will have no differenecs with normal Java
transparent objects.