|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectthinkmap.server.cron.CronJob
public class CronJob
A CronJob is a class that encapsulates an Interval and a Runnable job. you add it to the CronTab via the CronTab.addJob() method.
| Field Summary | |
|---|---|
protected Exception |
error
|
protected long |
lastRun
|
protected long |
nextRun
|
| Constructor Summary | |
|---|---|
CronJob(Interval i,
Runnable run)
Construct a CronJob to run a particular task at a particular interval. |
|
| Method Summary | |
|---|---|
protected CronJob |
addJob(CronJob cj)
|
Interval |
getInterval()
Gets the interval that describes how often this job will run. |
Exception |
getLastError()
Get the last error that occured when this job was run, null if no error has occured |
protected CronJob |
getNextJob()
|
Date |
getNextRunTime()
Get the date when this task will run next, or null if it is not currently in the queue |
protected void |
init()
|
boolean |
isRepeatOnError()
Gets if this job will continue to repeat if an error occurs while running it. |
protected CronJob |
removeJob(CronJob cj)
|
protected boolean |
run()
|
void |
setRepeatOnError(boolean b)
Sets if this job will continue to repeat if an error occurs while running it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Exception error
protected long lastRun
protected long nextRun
| Constructor Detail |
|---|
public CronJob(Interval i,
Runnable run)
| Method Detail |
|---|
public Interval getInterval()
public Date getNextRunTime()
public Exception getLastError()
public boolean isRepeatOnError()
public void setRepeatOnError(boolean b)
protected void init()
protected boolean run()
protected CronJob getNextJob()
protected CronJob removeJob(CronJob cj)
protected CronJob addJob(CronJob cj)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||