Package com.sun.jini.reliableLog
Class LogHandler
java.lang.Object
com.sun.jini.reliableLog.LogHandler
A LogHandler represents snapshots and update records as serializable objects.
This implementation does not know how to create an initial snaphot or apply an update to a snapshot. The client must specify these methods via a subclass.
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidapplyUpdate(Object update) Reads a stably logged update (a serializable object) from a stream.voidReads a stably logged update (a serializable object) from a stream.abstract voidrecover(InputStream in) Read the snapshot from a stream.abstract voidsnapshot(OutputStream out) Writes the snapshot to a stream.voidwriteUpdate(OutputStream out, Object value) Writes the representation (a serializable object) of an update to a stream.
-
Constructor Details
-
LogHandler
public LogHandler()Creates a LogHandler for a ReliableLog.
-
-
Method Details
-
snapshot
Writes the snapshot to a stream. This callback is invoked when the client calls the snaphot method of ReliableLog.- Parameters:
out- the output stream- Throws:
Exception- can raise any exception
-
recover
Read the snapshot from a stream. This callback is invoked when the client calls the recover method of ReliableLog.- Parameters:
in- the input stream- Throws:
Exception- can raise any exception
-
writeUpdate
Writes the representation (a serializable object) of an update to a stream. This callback is invoked when the client calls the update method of ReliableLog.- Parameters:
out- the output streamvalue- the update object- Throws:
Exception- can raise any exception
-
readUpdate
Reads a stably logged update (a serializable object) from a stream. This callback is invoked during recovery, once for every record in the log. After reading the update, this method invokes the applyUpdate (abstract) method in order to execute the update.- Parameters:
in- the input stream- Throws:
Exception- can raise any exception
-
applyUpdate
Reads a stably logged update (a serializable object) from a stream. This callback is invoked during recovery, once for every record in the log. After reading the update, this method is invoked in order to execute the update.- Parameters:
update- the update object- Throws:
Exception- can raise any exception
-