public class ScheduledExecutorServiceWrapper extends AbstractSubmitterScheduler
ScheduledThreadPoolExecutor
to use that
implementation with the SubmitterScheduler
.Constructor and Description |
---|
ScheduledExecutorServiceWrapper(java.util.concurrent.ScheduledExecutorService scheduler)
Constructs a new wrapper with the provided scheduler implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
scheduleAtFixedRate(java.lang.Runnable task,
long initialDelay,
long period)
Schedule a fixed rate recurring task to run.
|
void |
scheduleWithFixedDelay(java.lang.Runnable task,
long initialDelay,
long recurringDelay)
Schedule a fixed delay recurring task to run.
|
schedule, submitScheduled, submitScheduled
execute, submit, submit
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
submitScheduled
submit, submit, submit
public ScheduledExecutorServiceWrapper(java.util.concurrent.ScheduledExecutorService scheduler)
scheduler
- ScheduledExecutorService
implementationpublic void scheduleWithFixedDelay(java.lang.Runnable task, long initialDelay, long recurringDelay)
SubmitterScheduler
recurringDelay + runtime
for the provided task.
Unlike ScheduledExecutorService
if the task throws an exception,
subsequent executions are NOT suppressed or prevented. So if the task throws an exception on
every run, the task will continue to be executed at the provided recurring delay (possibly
throwing an exception on each execution).
task
- runnable to be executedinitialDelay
- delay in milliseconds until first runrecurringDelay
- delay in milliseconds for running task after last finishpublic void scheduleAtFixedRate(java.lang.Runnable task, long initialDelay, long period)
SubmitterScheduler
Unlike ScheduledExecutorService
if the task throws an exception,
subsequent executions are NOT suppressed or prevented. So if the task throws an exception on
every run, the task will continue to be executed at the provided recurring delay (possibly
throwing an exception on each execution).
task
- runnable to be executedinitialDelay
- delay in milliseconds until first runperiod
- amount of time in milliseconds between the start of recurring executions