|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--com.ds.fw.utils.FwTask
This class is a base class for all tasks that are going to be scheduled in a FwScheduler instance or have to execute a cyclic algorithm with a specified timeout between each iteration. Each task is executed in a separate thread. The action that will be executed in a cyclic manner has to overwrite the abstract method exec().The timeout between each iteration could be set with setTaskTimeout() method (in minutes). Tha task execution flow could be managed by the following methods: start() - starts the task; _suspend() - pauses the task but keeps it in its run() method, if the task is performing the exec() method when _suspend is called, it finishes its work first and then pauses; _resume() - resumes the suspended task; _stop() - stops the task by making it go out of the run() method scope, if the task is performing the exec() method when _stop is called, it finishes its work first and then stops.
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
FwTask()
Class constructor |
|
| Method Summary | |
void |
_resume()
This method is called by the Task scheduler to resume the paused Task |
void |
_stop()
This method is called by the Task scheduler to stop the Task |
void |
_suspend()
This method is called by the Task scheduler to pause the Task |
abstract boolean |
exec()
This method should be implemented by subclasses of this class |
long |
getDay()
|
long |
getHours()
|
long |
getMinutes()
|
long |
getMonth()
|
java.lang.String |
getPeriod()
|
long |
getRestartTime()
|
long |
getStartTime()
|
long |
getTaskTimeout()
Gets the Task timeout in minutes |
java.lang.String |
getType()
|
long |
getWDay()
|
long |
getYear()
|
void |
run()
|
void |
setDay(long n)
|
void |
setHours(long n)
|
void |
setMinutes(long n)
|
void |
setMonth(long n)
|
void |
setPeriod(java.lang.String n)
|
void |
setRestartTime(long n)
|
void |
setStartTime(long n)
|
void |
setTaskTimeout(long time)
Sets the task timeout |
void |
setType(java.lang.String n)
|
void |
setWDay(long n)
|
void |
setYear(long n)
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FwTask()
| Method Detail |
public long getTaskTimeout()
public void setTaskTimeout(long time)
public abstract boolean exec()
throws java.lang.Exception
java.lang.Exceptionpublic void _stop()
public void _suspend()
public void _resume()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic java.lang.String getPeriod()
public void setPeriod(java.lang.String n)
public java.lang.String getType()
public void setType(java.lang.String n)
public long getStartTime()
public void setStartTime(long n)
public long getRestartTime()
public void setRestartTime(long n)
public long getYear()
public void setYear(long n)
public long getMonth()
public void setMonth(long n)
public long getDay()
public void setDay(long n)
public long getWDay()
public void setWDay(long n)
public long getHours()
public void setHours(long n)
public long getMinutes()
public void setMinutes(long n)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||