|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ds.fw.utils.FwScheduler
This class manages a number of tasks. Each task is an instance of class, inheritor of the FwTask class. There could be one and only instance of this scheduler, which is referenced by the getInstance() method. A task is added to the scheduler by addTask() method which has two parameters, first is a name of the task and second - a task object. The name is the task's key and it is used in the managing process. An added task could be removed from the scheduler (removeTask()) or its object could be get (getTask()), by its name. The scheduler's work flow could be managed by methods similar to these of a task. The scheduler could be started (start() - starts all added tasks), suspended (suspend() - suspends all tasks), resumed (resume() - resumes all tasks) or stopped (stop() - stops all tasks and clears the scheduler's tasks list).
| Method Summary | |
void |
addTask(java.lang.String taskName,
com.ds.fw.utils.FwTask taskObject)
This method adds a new Task to the task table. |
void |
addTasks(com.ds.fw.co.schedulebroker.FwCoScheduleBroker coScheduleBroker)
|
static com.ds.fw.utils.FwScheduler |
getInstance()
This method returns a reference to the only instance of the Scheduler class |
com.ds.fw.utils.FwTask |
getTask(java.lang.String taskToGet)
This method gets a Task from the table |
java.util.Vector |
getTasks()
This method gets all tasks from the table and returns a vector with them |
static void |
main(java.lang.String[] args)
The main method first registers all tasks with the Scheduler,then runs them |
void |
removeTask(java.lang.String taskToBeRemoved)
This method removes a Task from the table and destroys its thread |
void |
resume()
This method is called to resume the stopped scheduler. |
void |
start()
This method is called to start the scheduler. |
void |
stop()
This method is called to remove all tasks |
void |
suspend()
This method is called to stop the scheduler. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static com.ds.fw.utils.FwScheduler getInstance()
public static void main(java.lang.String[] args)
public void start()
public void suspend()
public void resume()
public void stop()
public void addTask(java.lang.String taskName,
com.ds.fw.utils.FwTask taskObject)
public com.ds.fw.utils.FwTask getTask(java.lang.String taskToGet)
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Vector getTasks()
public void removeTask(java.lang.String taskToBeRemoved)
public void addTasks(com.ds.fw.co.schedulebroker.FwCoScheduleBroker coScheduleBroker)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||