net.sf.farrago.util
Class FarragoTimerTask

java.lang.Object
  extended by java.util.TimerTask
      extended by net.sf.farrago.util.FarragoTimerTask
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
FarragoDatabase.CheckpointTask, FarragoDatabase.WatchdogTask, FarragoTimerTest.BadTask, FarragoTimerTest.GoodTask

public abstract class FarragoTimerTask
extends TimerTask

FarragoTimerTask refines TimerTask to guarantee safety based on the way Farrago runs timers (see FarragoTimerAllocation).

TODO jvs 13-Aug-2007: add a facility for subclasses to be able to distinguish fatal exceptions from recoverable ones, so that timers can be allowed to keep running after an exception.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/util/FarragoTimerTask.java#4 $
Author:
John Sichi

Field Summary
private  Logger tracer
           
 
Constructor Summary
protected FarragoTimerTask(Logger tracer)
          Creates a new FarragoTimerTask.
 
Method Summary
 void run()
           
protected abstract  void runTimer()
          Runs the timer action as specified by subclass.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracer

private final Logger tracer
Constructor Detail

FarragoTimerTask

protected FarragoTimerTask(Logger tracer)
Creates a new FarragoTimerTask.

Parameters:
tracer - logger on which to trace exceptions
Method Detail

run

public final void run()
Specified by:
run in interface Runnable
Specified by:
run in class TimerTask

runTimer

protected abstract void runTimer()
Runs the timer action as specified by subclass.