|
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
org.prevayler.implementation.snapshot.XmlSnapshotManager
Writes and reads snapshots to/from XML files.
This implementation requires the Skaringa Java and XML language binding framework which provides for Java object XML serialization.
Note that Skaringa has some dependencies of its own. It requires the standard XML API's (xml-apis.jar from the Apache Xerces-j project or j2sdk1.4.x), an XML Transformation engine (Apache Xalan-j), and a logging api (Apache Jakarta Commons Logging), and, if desired, a logging implementation (Apache Jakarta Log4j or j2sdk1.4.x logging).
One more quick note. j2sdk1.4.x comes with an old buggy version of Xalan which you should override using the endorsed package override mechanism. To do this, add your preferred version of xalan.jar to JAVA_HOME/jre/lib/endorsed. You will need to create the 'endorsed' directory if it doesn't already exist. That is the *only* way to override packages that the JDK already provides in j2sdk1.4.x and above. In JDK1.3.x, this isn't a problem, although you will need to supply everything mentioned above on the classpath.
SnapshotManager
Constructor Summary | |
XmlSnapshotManager(java.lang.Object newPrevalentSystem,
java.lang.String snapshotDirectoryName)
|
Method Summary | |
java.lang.Object |
readSnapshot(java.io.InputStream in)
Deserializes and returns the object contained in snapshotFile. |
protected java.lang.String |
suffix()
Returns "snapshot", the default suffix/extension for snapshot files. |
void |
writeSnapshot(java.lang.Object prevalentSystem,
java.io.OutputStream out)
Serializes prevalentSystem and writes it to snapshotFile. |
Methods inherited from class org.prevayler.implementation.snapshot.SnapshotManager |
deepCopy, recoveredPrevalentSystem, recoveredVersion, writeSnapshot |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XmlSnapshotManager(java.lang.Object newPrevalentSystem, java.lang.String snapshotDirectoryName) throws java.lang.ClassNotFoundException, java.io.IOException
Method Detail |
public java.lang.Object readSnapshot(java.io.InputStream in) throws java.io.IOException
SnapshotManager
readSnapshot
in class SnapshotManager
java.io.IOException
SnapshotManager.readSnapshot(InputStream)
protected java.lang.String suffix()
SnapshotManager
suffix
in class SnapshotManager
SnapshotManager.suffix()
public void writeSnapshot(java.lang.Object prevalentSystem, java.io.OutputStream out) throws java.io.IOException
SnapshotManager
writeSnapshot
in class SnapshotManager
java.io.IOException
SnapshotManager.writeSnapshot(Object, OutputStream)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |