org.mmbase.applications.crontab
Class AbstractCronJob

java.lang.Object
  extended byorg.mmbase.applications.crontab.AbstractCronJob
All Implemented Interfaces:
CronJob, Runnable
Direct Known Subclasses:
MemoryWarner, MMBaseQueryJob, MMBaseStatsJob, RunnableCronJob, SampleCronJob, TestCronJob

public abstract class AbstractCronJob
extends Object
implements CronJob

A straight-forward abstract implementation of CronJob. If you exend it, you only need to implement run(), and the 'cronEntry' protected member var is available.

Author:
Michiel Meeuwissen

Field Summary
protected  CronEntry cronEntry
           
 
Constructor Summary
AbstractCronJob()
           
 
Method Summary
protected  void init()
          You can init by overriding this (no need to call super.init) This is called by init(CronEntry)
 void init(CronEntry cronEntry)
          If the CronJobs needs some initializing before the first run, then that can be put in this. Stores the CronEntry in protected member cronEntry.
abstract  void run()
          Implement this.
 void stop()
          Empty implementation (probably that's what you want)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cronEntry

protected CronEntry cronEntry
Constructor Detail

AbstractCronJob

public AbstractCronJob()
Method Detail

init

public final void init(CronEntry cronEntry)
If the CronJobs needs some initializing before the first run, then that can be put in this. Stores the CronEntry in protected member cronEntry. So extensions should override init() instead (in which they can use the cronEntry member).

Specified by:
init in interface CronJob

init

protected void init()
You can init by overriding this (no need to call super.init) This is called by init(CronEntry)


stop

public void stop()
Empty implementation (probably that's what you want)

Specified by:
stop in interface CronJob

run

public abstract void run()
Implement this.

Specified by:
run in interface CronJob


MMBase build 1.8.1.20060716