|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.SpyObject
net.spy.cron.Job
public abstract class Job
All Jobs should implement this interface.
| Constructor Summary | |
|---|---|
Job(java.lang.String name,
java.util.Date startDate)
Get a new Job with the given name and start date. |
|
Job(java.lang.String name,
java.util.Date startDate,
TimeIncrement ti)
Get a new recurring Job with the given name and start date that will run on an interval defined by the TimeIncrement. |
|
| Method Summary | |
|---|---|
void |
findNextRun()
Find the next time this Job should be run and adjust the start date accordingly. |
java.lang.String |
getName()
Get the name of this thing. |
java.util.Date |
getStartTime()
Get the time this job was requested to start. |
protected TimeIncrement |
getTimeIncrement()
Get the current TimeIncrement object incrementing the time on this job. |
boolean |
isAlive()
Is this job alive (is it running)? |
boolean |
isReady()
Is this Job ready to go? |
boolean |
isTrash()
Is this Job ready to be thrown away? |
protected void |
markFinished()
Mark this job as having stopped running. |
protected void |
markStarted()
Mark this job as having been started. |
void |
run()
Mark started, call runJob, then mark finished. |
protected abstract void |
runJob()
Subclasses of Job should extend this method to implement their running. |
void |
setName(java.lang.String to)
Set the name of this thing. |
void |
setStartTime(java.util.Date to)
Set the next time the job is due to start. |
protected void |
stopRunning()
Stop this job from running. |
java.lang.String |
toString()
Get a string representation of this Job. |
| Methods inherited from class net.spy.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Job(java.lang.String name,
java.util.Date startDate)
public Job(java.lang.String name,
java.util.Date startDate,
TimeIncrement ti)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic void setName(java.lang.String to)
public java.lang.String getName()
public java.util.Date getStartTime()
public void setStartTime(java.util.Date to)
public boolean isReady()
public final void run()
run in interface java.lang.Runnableprotected abstract void runJob()
public boolean isTrash()
protected TimeIncrement getTimeIncrement()
protected void markStarted()
public final void findNextRun()
protected void stopRunning()
public boolean isAlive()
protected void markFinished()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||