Interface Scheduler
public interface Scheduler
Schedules tasks to be executed in future.
- Since:
- 4.2.1
- Author:
- Sara Pellegrini
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionscheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit timeUnit) Schedules acommandto be executed periodically afterinitialDelay.voidCancels all scheduled tasks.
-
Method Details
-
scheduleWithFixedDelay
Scheduler.ScheduledTask scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit timeUnit) Schedules acommandto be executed periodically afterinitialDelay. Frequency of execution is represented bydelay. New task is scheduled after execution of current one.- Parameters:
command- the task to be executedinitialDelay- for how long the first execution is delayeddelay- frequency of task executiontimeUnit- the time unit- Returns:
- information about the schedule, and means to cancel it
-
shutdownNow
void shutdownNow()Cancels all scheduled tasks.
-