Interface SchedulerAdapter
- All Known Implementing Classes:
AbstractJavaScheduler
public interface SchedulerAdapter
A scheduler for running tasks using the systems provided by the platform
-
Method Summary
Modifier and TypeMethodDescriptionasync()Gets an async executor instanceasyncLater(Runnable task, long delay, TimeUnit unit) Executes the given task with a delay.asyncRepeating(Runnable task, long interval, TimeUnit unit) Executes the given task repeatedly at a given interval.default voidexecuteAsync(Runnable task) Executes a task asyncdefault voidexecuteSync(Runnable task) Executes a task syncvoidShuts down the executor instance.voidShuts down the scheduler instance.sync()Gets a sync executor instance
-
Method Details
-
async
Executor async()Gets an async executor instance- Returns:
- an async executor instance
-
sync
Executor sync()Gets a sync executor instance- Returns:
- a sync executor instance
-
executeAsync
Executes a task async- Parameters:
task- the task
-
executeSync
Executes a task sync- Parameters:
task- the task
-
asyncLater
Executes the given task with a delay.- Parameters:
task- the taskdelay- the delayunit- the unit of delay- Returns:
- the resultant task instance
-
asyncRepeating
Executes the given task repeatedly at a given interval.- Parameters:
task- the taskinterval- the intervalunit- the unit of interval- Returns:
- the resultant task instance
-
shutdownScheduler
void shutdownScheduler()Shuts down the scheduler instance.asyncLater(Runnable, long, TimeUnit)andasyncRepeating(Runnable, long, TimeUnit). -
shutdownExecutor
void shutdownExecutor()Shuts down the executor instance.
-