Interface Scheduler
- All Superinterfaces:
Executor
- All Known Implementing Classes:
ConcurrentScheduler
The
Scheduler
interface represents a means to execute
a task immediately or after a specified delay. This queues the
task for the requested period of time before it is executed, if a
delay is specified. How the task is executed is dependent on the
implementation, however it will normally use a thread pool.-
Method Summary
Modifier and TypeMethodDescriptionvoid
This will execute the task within the executor after the time specified has expired.void
This will execute the task within the executor after the time specified has expired.
-
Method Details
-
execute
This will execute the task within the executor after the time specified has expired. If the time specified is zero then it will be executed immediately. Once the scheduler has been stopped then this method will no longer accept runnable tasks.- Parameters:
task
- this is the task to schedule for executiondelay
- the time in milliseconds to wait for execution
-
execute
This will execute the task within the executor after the time specified has expired. If the time specified is zero then it will be executed immediately. Once the scheduler has been stopped then this method will no longer accept runnable tasks.- Parameters:
task
- this is the task to schedule for executiondelay
- this is the delay to wait before executionunit
- this is the duration time unit to wait for
-