|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.jdon.util.task.TaskEngine
public class TaskEngine
A TaskEngine object accepts Runnable objects and queues them for execution by worker threads.
Note: the current implementation of this class ignores priority. This may be changed in the future, however. this is s simple task/job engine, more power see Quartz or JMS usage:
TaskEngine taskEngine = new TaskEngine(); MyTask myTask = new MyTask(); engine.addTask(myTask, Thread.NORM_PRIORITY);MyTask must implements Runnable of Thread.
| 方法摘要 | |
|---|---|
static void |
addTask(Runnable r)
Adds a task to the task queue with normal priority. |
static void |
addTask(Runnable task,
int priority)
Adds a task to the task queue. |
static TimerTask |
scheduleTask(Runnable task,
int priority,
long delay,
long period)
Schedules a task to periodically run. |
static TimerTask |
scheduleTask(Runnable task,
long delay,
long period)
Schedules a task to periodically run. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 方法详细信息 |
|---|
public static void addTask(Runnable r)
public static void addTask(Runnable task,
int priority)
The priority of the task can be specified and must be one of the following values:
task - the task to execute
public static TimerTask scheduleTask(Runnable task,
long delay,
long period)
task - task to be scheduled.delay - delay in milliseconds before task is to be executed.period - time in milliseconds between successive task executions.
public static TimerTask scheduleTask(Runnable task,
int priority,
long delay,
long period)
task - task to be scheduled.priority - the priority the periodic task should run at.delay - delay in milliseconds before task is to be executed.period - time in milliseconds between successive task executions.
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||