Class JOP.persist.file.FilePersistManager
All Packages  Class Hierarchy  This Package  Previous  Next  Index  Home

Class JOP.persist.file.FilePersistManager

java.lang.Object
   |
   +----JOP.persist.PersistManager
           |
           +----JOP.persist.file.FilePersistManager

public class FilePersistManager
extends PersistManager
The class saves and read objects to a random access file.

See Also:
PersistManager

Constructor Index

 o FilePersistManager(String)
Initialise a FilePeristManager with the name of a RandomAccessFile.

Method Index

 o close()
End use of the persist manager

 o open()
Begin using the perist manager

 o streamInObject(long)
Retrieves an object previously saved by 'streamOutObject()'.
 o streamOutObject(Object)
Save the object in the Random Access File.

Constructors

 o FilePersistManager
  public FilePersistManager(String f)
Initialise a FilePeristManager with the name of a RandomAccessFile.

Methods

 o open
  public void open() throws Exception
Begin using the perist manager

Overrides:
open in class PersistManager
See Also:
PersistManager
 o close
  public void close() throws Exception
End use of the persist manager

Overrides:
close in class PersistManager
See Also:
PersistManager
 o streamOutObject
  public long streamOutObject(Object o) throws Exception
Save the object in the Random Access File. The object must either implement Persistable, have a custom marshall class available or it will be marshalled by native methods. The object and all of the objects referenced by the object are saved. Loops are detected and avoided.

To retrieve the object call 'streamInObject()'

Parameters:
o - The object to be saved
Returns:
s The unique identifier of the object
Overrides:
streamOutObject in class PersistManager
See Also:
PersistManager, Persistable, PersistMarshall, streamInObject
 o streamInObject
  public Object streamInObject(long xid) throws Exception
Retrieves an object previously saved by 'streamOutObject()'. The unique object id is passed and an object and all of the objects referenced by the object are returned. The object will be an instance of the same type that was saved and will have the same context. The caller of this method must explicitly cast the returned object before using it.

Within a consistency unit multiple reads of an object either directly (via this method) or indirectly because the object is referenced by another object will not create secondary instances.

Parameters:
id - Unique indentifier of the object
Returns:
s The object
Overrides:
streamInObject in class PersistManager
See Also:
PersistManager

All Packages  Class Hierarchy  This Package  Previous  Next  Index  Home