to.etc.domui.util.janitor
Class JanitorTask

java.lang.Object
  extended by to.etc.domui.util.janitor.JanitorTask

public abstract class JanitorTask
extends java.lang.Object

Holds a single Janitor request. It holds the administrative details also, like the (next) start time and the interval time.


Field Summary
protected  boolean m_deleted
          T if this task was removed
protected  Janitor m_j
          The janitor..
protected  int m_key
          This-task's key (id) in the task vector
protected  int m_run_slot
          If this is running, the slot number it runs in, or -1 if not running
protected  int m_t_interval
          The interval time, in seconds, to run this again,
protected  long m_t_lastrun
          The time this task ran last,
protected  long m_t_next
          The NEXT time this task has to run, or -1 when it (still) runs..
protected  java.lang.String m_taskname
          This-task's display string
protected  boolean m_unrunnable
          T if this task is unrunnable (too many exceptions)
 
Constructor Summary
JanitorTask()
           
 
Method Summary
protected  void calcNextStartTime()
          Called by the janitor to make this task set it's next start time.
 long getNextStartTime()
          Returns the NEXT start time for this request, depending on the current time.
abstract  void run()
          The function-to-override.
protected  void setNextTime(java.util.Date dt)
          Sets a fixed start date for the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_j

protected Janitor m_j
The janitor..


m_t_interval

protected int m_t_interval
The interval time, in seconds, to run this again,


m_t_next

protected long m_t_next
The NEXT time this task has to run, or -1 when it (still) runs..


m_t_lastrun

protected long m_t_lastrun
The time this task ran last,


m_key

protected int m_key
This-task's key (id) in the task vector


m_taskname

protected java.lang.String m_taskname
This-task's display string


m_run_slot

protected int m_run_slot
If this is running, the slot number it runs in, or -1 if not running


m_deleted

protected boolean m_deleted
T if this task was removed


m_unrunnable

protected boolean m_unrunnable
T if this task is unrunnable (too many exceptions)

Constructor Detail

JanitorTask

public JanitorTask()
Method Detail

run

public abstract void run()
                  throws java.lang.Exception
The function-to-override.

Throws:
java.lang.Exception

getNextStartTime

public long getNextStartTime()
Returns the NEXT start time for this request, depending on the current time. The next start time must be somewhere in the future or it can be NOW (0). This function can be overridden for more complex timing requirements.


calcNextStartTime

protected void calcNextStartTime()
Called by the janitor to make this task set it's next start time.


setNextTime

protected void setNextTime(java.util.Date dt)
Sets a fixed start date for the task.