Class LogHandler

java.lang.Object
com.sun.jini.reliableLog.LogHandler

public abstract class LogHandler extends Object
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 Details

    • LogHandler

      public LogHandler()
      Creates a LogHandler for a ReliableLog.
  • Method Details

    • snapshot

      public abstract void snapshot(OutputStream out) throws Exception
      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

      public abstract void recover(InputStream in) throws Exception
      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

      public void writeUpdate(OutputStream out, Object value) throws Exception
      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 stream
      value - the update object
      Throws:
      Exception - can raise any exception
    • readUpdate

      public void readUpdate(InputStream in) throws Exception
      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

      public abstract void applyUpdate(Object update) throws Exception
      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