|
Prevayler™
The Free Software Prevalence Layer |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.prevayler.implementation.snapshot.SnapshotManager
Writes and reads snapshots to/from files. You can extend this class to use a serialization mechanism other than Java's. E.g: XML.
Constructor Summary | |
SnapshotManager(java.lang.Object newPrevalentSystem,
java.lang.String snapshotDirectoryName)
|
Method Summary | |
java.lang.Object |
deepCopy(java.lang.Object original,
java.lang.String errorMessage)
|
java.lang.Object |
readSnapshot(java.io.InputStream in)
Deserializes and returns the object contained in snapshotFile. |
java.lang.Object |
recoveredPrevalentSystem()
|
long |
recoveredVersion()
|
protected java.lang.String |
suffix()
Returns "snapshot", the default suffix/extension for snapshot files. |
void |
writeSnapshot(java.lang.Object prevalentSystem,
long version)
|
void |
writeSnapshot(java.lang.Object prevalentSystem,
java.io.OutputStream out)
Serializes prevalentSystem and writes it to snapshotFile. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SnapshotManager(java.lang.Object newPrevalentSystem, java.lang.String snapshotDirectoryName) throws java.lang.ClassNotFoundException, java.io.IOException
snapshotDirectoryName
- The path of the directory where the last snapshot file will be read and where the new snapshot files will be created.Method Detail |
public java.lang.Object recoveredPrevalentSystem()
public long recoveredVersion()
public void writeSnapshot(java.lang.Object prevalentSystem, long version) throws java.io.IOException
java.io.IOException
public void writeSnapshot(java.lang.Object prevalentSystem, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
protected java.lang.String suffix()
public java.lang.Object readSnapshot(java.io.InputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object deepCopy(java.lang.Object original, java.lang.String errorMessage)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |