ScheduledExecutorService in order to capture context via
ContextSnapshot when a task is submitted, and propagate context to the task
when it is executed.
| Access | Constructor and Description |
|---|---|
| private | ContextScheduledExecutorService(ScheduledExecutorService
the service, Supplier<ContextSnapshot> ScheduledExecutorService to delegate tosupplier of the snapshotSupplier)ContextSnapshot - instruction on
who to retrieve ContextSnapshot when tasks are scheduledCreate an instance |
| Modifier and Type | Method and Description |
|---|---|
| public ScheduledFuture | schedule(Runnable
the task to execute command, long the time from now to delay execution delay, TimeUnit the time unit of the delay parameter unit)Implements java. |
| public <V> ScheduledFuture | schedule(Callable<V>
the function to execute callable, long the time from now to delay execution delay, TimeUnit the time unit of the delay parameter unit)Implements java. |
| public ScheduledFuture | scheduleAtFixedRate(Runnable
the task to execute command, long the time to delay first execution initialDelay, long the period between successive executions period, TimeUnit the time unit of the initialDelay and period parameters unit)Implements java. initialDelay, then initialDelay + period, then
initialDelay + 2 * period, and so on.
|
| public ScheduledFuture | scheduleWithFixedDelay(Runnable
the task to execute command, long the time to delay first execution initialDelay, long the delay between the termination of one
execution and the commencement of the next delay, TimeUnit the time unit of the initialDelay and delay parameters unit)Implements java. |
| public static ScheduledExecutorService | wrap(ScheduledExecutorService
the executorService to wrap service, Supplier<ContextSnapshot> supplier for capturing a supplier)ContextSnapshot at the point when
tasks are scheduledWrap the given |
| public static ScheduledExecutorService | wrap(ScheduledExecutorService
the executorService to wrap service)
Deprecated
use
Variant of wrap(ScheduledExecutorService, Supplier)
wrap(ScheduledExecutorService, Supplier) that uses
ContextSnapshot#captureAll(Object.
|
| ContextScheduledExecutorService | back to summary |
|---|---|
| private ContextScheduledExecutorService(ScheduledExecutorService service, Supplier<ContextSnapshot> snapshotSupplier) Create an instance
| |
| schedule | back to summary |
|---|---|
| public ScheduledFuture Implements java. Doc from java. Submits a one-shot task that becomes enabled after the given delay.
| |
| schedule | back to summary |
|---|---|
| public <V> ScheduledFuture Implements java. Doc from java. Submits a value-returning one-shot task that becomes enabled after the given delay.
| |
| scheduleAtFixedRate | back to summary |
|---|---|
| public ScheduledFuture Implements java. Doc from java. Submits a periodic action that becomes enabled first after the
given initial delay, and subsequently with the given period;
that is, executions will commence after
The sequence of task executions continues indefinitely until one of the following exceptional completions occur:
isDone() on the returned future will
return true.
If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.
| |
| scheduleWithFixedDelay | back to summary |
|---|---|
| public ScheduledFuture Implements java. Doc from java. Submits a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next. The sequence of task executions continues indefinitely until one of the following exceptional completions occur:
isDone() on the returned future will
return true.
| |
| wrap | back to summary |
|---|---|
| public static ScheduledExecutorService wrap(ScheduledExecutorService service, Supplier<ContextSnapshot> supplier) Wrap the given
| |
| wrap | back to summary |
|---|---|
| public static ScheduledExecutorService wrap(ScheduledExecutorService service)
Deprecated Variant of
| |