public final class DelegatingTaskScheduler extends Object implements TaskScheduler
| Constructor and Description |
|---|
DelegatingTaskScheduler(ScheduledExecutorService scheduledExecutorService,
ExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable command) |
<V> ScheduledFuture<Future<V>> |
schedule(Callable<V> command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled
after the given delay.
|
ScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled
after the given delay.
|
ScheduledFuture<?> |
scheduleWithRepetition(Runnable command,
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.
|
public DelegatingTaskScheduler(ScheduledExecutorService scheduledExecutorService, ExecutorService executor)
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
TaskSchedulerschedule in interface TaskSchedulercommand - the task to executedelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return
null upon completionpublic <V> ScheduledFuture<Future<V>> schedule(Callable<V> command, long delay, TimeUnit unit)
TaskSchedulerschedule in interface TaskSchedulercommand - the task to executedelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return
<V> upon completionpublic ScheduledFuture<?> scheduleWithRepetition(Runnable command, long initialDelay, long period, TimeUnit unit)
TaskSchedulerinitialDelay then initialDelay+period, then
initialDelay + 2 * period, and so on.
If any execution of this task
takes longer than its period, then subsequent execution will be skipped.scheduleWithRepetition in interface TaskSchedulercommand - the task to executeinitialDelay - the time to delay first executionperiod - the period between successive executionsunit - the time unit of the initialDelay and period parametersget() method will throw an
exception upon cancellationCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.