org.mmbase.applications.crontab
Class AbstractCronJob

Package class diagram package AbstractCronJob
java.lang.Object
  extended by org.mmbase.applications.crontab.AbstractCronJob
All Implemented Interfaces:
Runnable, CronJob
Direct Known Subclasses:
MemoryWarner, MMBaseCacheClearerJob, 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
 CronEntry getEntry()
           
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.
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

getEntry

public final CronEntry getEntry()
Specified by:
getEntry in interface CronJob

run

public abstract void run()
Implement this.

Specified by:
run in interface Runnable
Specified by:
run in interface CronJob


MMBase Crontab 2.0-SNAPSHOT - 2013-03-30T06:40