JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.core
Class AbstractCheckpointable

java.lang.Object
  extended bygov.nasa.javaGenes.core.AbstractCheckpointable
All Implemented Interfaces:
gov.nasa.javaGenes.core.Checkpointable, java.io.Serializable
Direct Known Subclasses:
Run

public abstract class AbstractCheckpointable
extends java.lang.Object
implements gov.nasa.javaGenes.core.Checkpointable

Classes which wish to be Checkpointable can use this as a superclass which will do some standard implementations of the Checkpointable interface.

See Also:
Serialized Form

Field Summary
protected  Checkpointer checkpointer
           
 
Constructor Summary
AbstractCheckpointable()
           
 
Method Summary
 void afterCheckpoint()
          will be called just after a checkpoint.
 void beforeCheckpoint()
          will be called just before a checkpoint.
abstract  void restart()
          Restart the process after a checkpoint and process death
 void setCheckpointer(Checkpointer c)
          Remember the Checkpointer object that will checkpoint "this"
abstract  void start(java.lang.String[] arguments)
          Start the Checkpointable process for the first time.
 void stateSave(TokenizeOutput tokenizer)
          called to implement a fast checkpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkpointer

protected Checkpointer checkpointer
Constructor Detail

AbstractCheckpointable

public AbstractCheckpointable()
Method Detail

setCheckpointer

public void setCheckpointer(Checkpointer c)
Description copied from interface: gov.nasa.javaGenes.core.Checkpointable
Remember the Checkpointer object that will checkpoint "this"

Specified by:
setCheckpointer in interface gov.nasa.javaGenes.core.Checkpointable

start

public abstract void start(java.lang.String[] arguments)
Description copied from interface: gov.nasa.javaGenes.core.Checkpointable
Start the Checkpointable process for the first time.

Specified by:
start in interface gov.nasa.javaGenes.core.Checkpointable
Parameters:
arguments - the array of strings past to static void main()

restart

public abstract void restart()
Description copied from interface: gov.nasa.javaGenes.core.Checkpointable
Restart the process after a checkpoint and process death

Specified by:
restart in interface gov.nasa.javaGenes.core.Checkpointable

beforeCheckpoint

public void beforeCheckpoint()
Description copied from interface: gov.nasa.javaGenes.core.Checkpointable
will be called just before a checkpoint. Can be overridden to gain control to set timers, clean up state, etc.

Specified by:
beforeCheckpoint in interface gov.nasa.javaGenes.core.Checkpointable

afterCheckpoint

public void afterCheckpoint()
Description copied from interface: gov.nasa.javaGenes.core.Checkpointable
will be called just after a checkpoint. Complements beforeCheckpoint()

Specified by:
afterCheckpoint in interface gov.nasa.javaGenes.core.Checkpointable

stateSave

public void stateSave(TokenizeOutput tokenizer)
Description copied from interface: gov.nasa.javaGenes.core.Checkpointable
called to implement a fast checkpoint. Serialization can also be used but it is slow.

Specified by:
stateSave in interface gov.nasa.javaGenes.core.Checkpointable

JavaGenes, NASA Ames. Written largely by Al Globus