|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ScheduledTaskService
A service to execute tasks periodically, or after a delay.
TaskService| Method Summary | |
|---|---|
ScheduledFuture<?> |
addRepeatingTask(Runnable runnable,
long initialDelay,
long period,
TimeUnit timeUnit)
Enqueues a task to run periodically. |
ScheduledFuture<?> |
addScheduledTask(Runnable runnable,
long delay,
TimeUnit timeUnit)
Enqueues a task to run after a delay. |
void |
addTask(Runnable runnable)
Enqueues a task to run. |
void |
shutdown(boolean immediately)
Shut down the service. |
| Method Detail |
|---|
ScheduledFuture<?> addRepeatingTask(Runnable runnable,
long initialDelay,
long period,
TimeUnit timeUnit)
ScheduledExecutorService.scheduleAtFixedRate(java.lang.Runnable, long, long, java.util.concurrent.TimeUnit). Duplicate tasks are ignored.
runnable - the task to add.initialDelay - delay before the first execution of the task. timeUnit determines the units of the
value.period - interval between executions of the task. timeUnit determines the units of the value.timeUnit - time unit of initialDelay and period.
null if
the task was not enqueued.
IllegalArgumentException - if runnable is null
ScheduledFuture<?> addScheduledTask(Runnable runnable,
long delay,
TimeUnit timeUnit)
runnable - the task to add.delay - delay before execution of the task. timeUnit determines the units of the value.timeUnit - time unit of initialDelay and period.
null if
the task was not enqueued.
IllegalArgumentException - if runnable is nullvoid addTask(Runnable runnable)
runnable - the task to add
IllegalArgumentException - if runnable is nullvoid shutdown(boolean immediately)
immediate parameter is true, the service will attempt to stop all
active tasks, and will not begin work on any other tasks in the queue. Otherwise, the service will complete all
tasks in the work queue, but will not accept any new tasks.
immediately - true to shutdown immediately.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||