com.sun.jini.phoenix
Class Activation.ActLogHandler

java.lang.Object
  extended by com.sun.jini.reliableLog.LogHandler
      extended by com.sun.jini.phoenix.Activation.ActLogHandler
Enclosing class:
Activation

private static class Activation.ActLogHandler
extends LogHandler

Handler for the log that knows how to take the initial snapshot and apply an update (a LogRecord) to the current state.


Field Summary
private  Activation state
           
 
Constructor Summary
Activation.ActLogHandler()
           
 
Method Summary
 void applyUpdate(Object update)
          Reads a stably logged update (a serializable object) from a stream.
 Activation getState()
           
 void readUpdate(InputStream in)
          Reads a stably logged update (a serializable object) from a stream.
 void recover(InputStream in)
          Read the snapshot from a stream.
 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
 

Field Detail

state

private Activation state
Constructor Detail

Activation.ActLogHandler

Activation.ActLogHandler()
Method Detail

getState

public Activation getState()

snapshot

public void snapshot(OutputStream out)
              throws Exception
Description copied from class: LogHandler
Writes the snapshot to a stream. This callback is invoked when the client calls the snaphot method of ReliableLog.

Specified by:
snapshot in class LogHandler
Parameters:
out - the output stream
Throws:
Exception - can raise any exception

recover

public void recover(InputStream in)
             throws Exception
Description copied from class: LogHandler
Read the snapshot from a stream. This callback is invoked when the client calls the recover method of ReliableLog.

Specified by:
recover in class LogHandler
Parameters:
in - the input stream
Throws:
Exception - can raise any exception

writeUpdate

public void writeUpdate(OutputStream out,
                        Object value)
                 throws Exception
Description copied from class: LogHandler
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.

Overrides:
writeUpdate in class LogHandler
Parameters:
out - the output stream
value - the update object
Throws:
Exception - can raise any exception

readUpdate

public void readUpdate(InputStream in)
                throws Exception
Description copied from class: LogHandler
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.

Overrides:
readUpdate in class LogHandler
Parameters:
in - the input stream
Throws:
Exception - can raise any exception

applyUpdate

public void applyUpdate(Object update)
                 throws Exception
Description copied from class: LogHandler
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.

Specified by:
applyUpdate in class LogHandler
Parameters:
update - the update object
Throws:
Exception - can raise any exception


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.