02/28/2005
 

com.epicentric.task
Class TaskScheduler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.epicentric.task.TaskScheduler
All Implemented Interfaces:
Runnable

Deprecated. As of version 4.0, to be removed in 8.0 or later. It has been replaced with TaskManager

public class TaskScheduler
extends Thread

TaskScheduler can iterate over scheduled tasks until there are no more to schedule, or until a shutdown time. To use, create an array of tasks. Instantiate the TaskScheduler, then start() it (to run on a thread) or run() it (to run on the current thread). It is recommended you run it on its own thread if the schedules for your tasks can cause TaskScheduler to sleep.


Field Summary
protected  Date runUntilDateTime
          Deprecated.  
protected  boolean shutdown
          Deprecated.  
protected  Task[] tasks
          Deprecated.  
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TaskScheduler(Task task)
          Deprecated. Constructor.
TaskScheduler(Task[] tasks)
          Deprecated. Constructor for a TaskScheduler.
 
Method Summary
protected  Task getNextTask()
          Deprecated. Get the next scheduled task, removing any that don't need to be run any more.
 void run()
          Deprecated. Evaluate the schedule of all tasks.
 void setPauseWhileWaitingForTask(long pauseForTaskCompletion)
          Deprecated. Set how long, in milliseconds, to sleep while waiting for tasks to finish when no other tasks to run.
 void setReportWhenSleeping(boolean reportWhenSleeping)
          Deprecated. Set whether or not to echo a message when going to sleep.
 void setRunUntilTime(Date runUntilDateTime)
          Deprecated. Use date/time passed as a limiter on execution.
 
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
 

Field Detail

tasks

protected Task[] tasks
Deprecated. 

runUntilDateTime

protected Date runUntilDateTime
Deprecated. 

shutdown

protected boolean shutdown
Deprecated. 
Constructor Detail

TaskScheduler

public TaskScheduler(Task[] tasks)
Deprecated. 
Constructor for a TaskScheduler.
Parameters:
tasks - Array of tasks to iterate over.

TaskScheduler

public TaskScheduler(Task task)
Deprecated. 
Constructor. Use if you have only one task.
Method Detail

run

public void run()
Deprecated. 
Evaluate the schedule of all tasks. Sleep until one should be run. Wake up and run it. Quit when there are no more tasks to run or when either maxRuns or runUntilDateTime is reached.
Overrides:
run in class Thread

getNextTask

protected Task getNextTask()
Deprecated. 
Get the next scheduled task, removing any that don't need to be run any more. Return null if no tasks to run right now. Note this can mean all tasks are finished, or that some are still running.
Returns:
Task or null if no tasks to be run right now.

setRunUntilTime

public void setRunUntilTime(Date runUntilDateTime)
Deprecated. 
Use date/time passed as a limiter on execution.
Parameters:
runUntilDateTime - provides for shutdown. Can be null.

setReportWhenSleeping

public void setReportWhenSleeping(boolean reportWhenSleeping)
Deprecated. 
Set whether or not to echo a message when going to sleep.

setPauseWhileWaitingForTask

public void setPauseWhileWaitingForTask(long pauseForTaskCompletion)
Deprecated. 
Set how long, in milliseconds, to sleep while waiting for tasks to finish when no other tasks to run.

02/28/2005
 

Copyright and Trademark Notices