public interface TaskManagerService
Modifier and Type | Method and Description |
---|---|
void |
execute(Task task) |
ScheduledFuture |
schedule(Task task,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay.
|
ScheduledFuture |
scheduleAtFixedRate(Task task,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after
the given initial delay, and subsequently with the given period; that is
executions will commence after initialDelay then initialDelay+period,
then initialDelay + 2 * period, and so on.
|
ScheduledFuture |
scheduleWithFixedDelay(Task task,
long initialDelay,
long delay,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after
the given initial delay, and subsequently with the given delay between
the termination of one execution and the commencement of the next.
|
void execute(Task task)
ScheduledFuture schedule(Task task, long delay, TimeUnit unit)
task
- The task to be scheduled.delay
- Initial delay before the task is executedunit
- seconds, milliseconds etc for delayScheduledFuture scheduleAtFixedRate(Task task, long initialDelay, long period, TimeUnit unit)
task
- The task to be scheduled.initialDelay
- Initial delay before the task is first done.period
- Fixed period of execution.unit
- seconds, milliseconds etc for delay.ScheduledFuture scheduleWithFixedDelay(Task task, long initialDelay, long delay, TimeUnit unit)
task
- The task to be scheduled.initialDelay
- Initial delay before the task is first done.delay
- The delay between each subsequent executionunit
- seconds, milliseconds etc for delay.Copyright © 2013. All Rights Reserved.