Class TaskScheduler
java.lang.Object
org.deltava.taskman.TaskScheduler
- All Implemented Interfaces:
Runnable
,Thread.UncaughtExceptionHandler
A class to control execution of Scheduled Tasks. This operates much like a Unix-style cron daemon in that it checks whether a task should be executed once every 60 seconds.
- Since:
- 1.0
- Version:
- 11.1
- Author:
- Luke
-
Constructor Summary
ConstructorsConstructorDescriptionTaskScheduler
(Collection<Task> tasks) Initializes the Task scheduler with a group of Tasks. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Schedules a Task for execution.Retrieves a Task for manual execution.Returns the current state of the Task Schedulder.final void
run()
void
Updates the last execution time and duration of a Scheduled Task.toString()
void
uncaughtException
(Thread t, Throwable e)
-
Constructor Details
-
TaskScheduler
Initializes the Task scheduler with a group of Tasks.- Parameters:
tasks
- a Collection of Tasks
-
-
Method Details
-
toString
-
addTask
-
getTask
-
run
-
setLastRunTime
Updates the last execution time and duration of a Scheduled Task.- Parameters:
lr
- the TaskLastRun bean
-
getTaskInfo
Returns the current state of the Task Schedulder.- Returns:
- a Collection of TaskInfo beans
-
uncaughtException
- Specified by:
uncaughtException
in interfaceThread.UncaughtExceptionHandler
-