org.datamanager.persistence.serializable
Class SerializableDataAccessObject

java.lang.Object
  |
  +--org.datamanager.persistence.serializable.SerializableDataAccessObject
All Implemented Interfaces:
DataAccessObject

public class SerializableDataAccessObject
extends Object
implements DataAccessObject

Supports persistence of objects across sessions using plain Java serialization. All objects persisted with this class must implement Serializable.

Author:
Matt Liggett

Constructor Summary
SerializableDataAccessObject()
           
 
Method Summary
 void persist(Object object, File file)
          keep the object as a xml file in the disk
 void persist(Object object, OutputStream outputStream)
          keep the object as a xml file in the disk
 Object restore(File fileLocation)
          return the instance object which store in the xml file the client need to cast the return to the correct type.
 Object restore(InputStream inputStream)
          return the instance object which store in the xml file the client need to cast the return to the correct type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializableDataAccessObject

public SerializableDataAccessObject()
Method Detail

persist

public void persist(Object object,
                    File file)
Description copied from interface: DataAccessObject
keep the object as a xml file in the disk

Specified by:
persist in interface DataAccessObject
Parameters:
object - any object
file - name and path to keep the object as file on disk

restore

public Object restore(File fileLocation)
Description copied from interface: DataAccessObject
return the instance object which store in the xml file the client need to cast the return to the correct type.

Specified by:
restore in interface DataAccessObject
Parameters:
fileLocation - xml file path
Returns:
an instance which restore state from the xml file

persist

public void persist(Object object,
                    OutputStream outputStream)
Description copied from interface: DataAccessObject
keep the object as a xml file in the disk

Specified by:
persist in interface DataAccessObject
Parameters:
object - any object
outputStream - write to output stream

restore

public Object restore(InputStream inputStream)
Description copied from interface: DataAccessObject
return the instance object which store in the xml file the client need to cast the return to the correct type.

Specified by:
restore in interface DataAccessObject
Parameters:
inputStream - read from input stream
Returns:
an instance which restore state from the xml file


See the Helium Website