public interface Scheduler extends ScheduledExecutorService
Scheduler instances may be
backed by the same ExecutorService, allowing for a fine control of the source of the tasks that the underlying
ExecutorService will run.
See ScheduledExecutorService and ExecutorService for documentation on the provided methods.
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Returns a name that indicates where was this scheduler created.
|
ScheduledFuture<?> |
scheduleWithCronExpression(Runnable command,
String cronExpression)
Creates and executes a periodic action that becomes enabled according to given
cronExpression and timeZone. |
ScheduledFuture<?> |
scheduleWithCronExpression(Runnable command,
String cronExpression,
TimeZone timeZone)
Creates and executes a periodic action that becomes enabled according to given
cronExpression in the given
timeZone. |
void |
stop()
Tries to do a graceful shutdown.
|
schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelayawaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submitScheduledFuture<?> scheduleWithCronExpression(Runnable command, String cronExpression)
cronExpression and timeZone.
If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only
terminate via cancellation or termination of the executor. If any execution of this task takes longer than the time before
the next execution should start, then subsequent executions may start late, but will not concurrently execute.command - the task to executecronExpression - the
cron expression
string to base the schedule on.get() method will throw an exception
upon cancellationRejectedExecutionException - if the task cannot be scheduled for executionNullPointerException - if command is nullScheduledFuture<?> scheduleWithCronExpression(Runnable command, String cronExpression, TimeZone timeZone)
cronExpression in the given
timeZone. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the
task will only terminate via cancellation or termination of the executor. If any execution of this task takes longer than the
time before the next execution should start, then subsequent executions may start late, but will not concurrently execute.command - the task to executecronExpression - the
cron expression
string to base the schedule on.timeZone - the time-zone for the schedule.get() method will throw an exception
upon cancellationRejectedExecutionException - if the task cannot be scheduled for executionNullPointerException - if command is nullvoid stop()
If this hasn't terminated after a time configured on instantiation, a forceful shutdown takes place.
String getName()
Copyright © 2017 MuleSoft, Inc.. All rights reserved.