GigaSpaces XAP 9.7.2 API

com.sun.jini.reliableLog
Class LogHandler

java.lang.Object
  extended by 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:
ReliableLog

Constructor Summary
LogHandler()
          Creates a LogHandler for a ReliableLog.
 
Method Summary
abstract  void applyUpdate(Object update)
          Reads a stably logged update (a serializable object) from a stream.
 void readUpdate(InputStream in)
          Reads a stably logged update (a serializable object) from a stream.
abstract  void recover(InputStream in)
          Read the snapshot from a stream.
abstract  void snapshot(OutputStream out)
          Writes the snapshot to a stream.
 void writeUpdate(OutputStream out, Object value)
          Writes the representation (a serializable object) of an update to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogHandler

public LogHandler()
Creates a LogHandler for a ReliableLog.

Method Detail

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

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.