public final class GenericScheduledExecutorService extends Objectimplements SchedulerLifecycle
ScheduledExecutorService that can be used for scheduling actions when a
Scheduler implementation doesn't have that ability.
For example if a Scheduler is given an Executor or {ExecutorService instead of ScheduledExecutorService.
NOTE: No actual work should be done on tasks submitted to this executor. Submit a task with the appropriate delay which then in turn invokes the work asynchronously on the appropriate Scheduler implementation. This means for example that you would not use this approach along with TrampolineScheduler or ImmediateScheduler.
| Modifier and Type | Field and Description |
|---|---|
static GenericScheduledExecutorService |
INSTANCE
|
| Modifier and Type | Method and Description |
|---|---|
static ScheduledExecutorService |
getInstance()
See class Javadoc for information on what this is for and how to use.
|
void |
shutdown()
Instructs the Scheduler instance to stop threads and stop accepting tasks on any outstanding Workers.
|
void |
start()
Allows the Scheduler instance to start threads and accept tasks on them.
|
public static final GenericScheduledExecutorServiceINSTANCE
public void start()
SchedulerLifecycle
Implementations should make sure the call is idempotent and threadsafe.
public void shutdown()
SchedulerLifecycle
Implementations should make sure the call is idempotent and threadsafe.
public static ScheduledExecutorServicegetInstance()
ScheduledExecutorService for generic use.