It supports both non-trampolined worker (for cases where the trampolining happens externally) and trampolined worker. This scheduler is NOT time-capable (can't schedule with delay / periodically).
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | ExecutorScheduler.ExecutorPlainRunnable
A non-tracked runnable that wraps a task and offers cancel support in the form of not executing the task. |
| pack-priv static class | ExecutorScheduler.ExecutorSchedulerTrampolineWorker
A trampolining worker that tracks tasks. |
| pack-priv static class | ExecutorScheduler.ExecutorSchedulerWorker
A non-trampolining worker that tracks tasks. |
| pack-priv static class | ExecutorScheduler.ExecutorTrackedRunnable
A Runnable that wraps a task and has reference back to its parent worker to remove itself once completed or cancelled |
| pack-priv static interface | ExecutorScheduler.WorkerDelete
Common interface between the tracking workers to signal the need for removal. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Executor | |
| pack-priv volatile boolean | |
| pack-priv final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Scheduler. | createWorker()
Implements reactor. |
| public void | dispose()
Overrides default reactor. |
| public boolean | isDisposed()
Overrides default reactor. |
| public Object | scanUnsafe(Scannable.
a keyAttr to resolve for the component.Implements reactor. |
| public Disposable | schedule(Runnable
the task to execute task)Implements reactor. |
| public String |
| executor | back to summary |
|---|---|
| pack-priv final Executor executor | |
| terminated | back to summary |
|---|---|
| pack-priv volatile boolean terminated | |
| trampoline | back to summary |
|---|---|
| pack-priv final boolean trampoline | |
| ExecutorScheduler | back to summary |
|---|---|
| pack-priv ExecutorScheduler(Executor executor, boolean trampoline) | |
| createWorker | back to summary |
|---|---|
| public Scheduler. Implements reactor. Doc from reactor. Creates a worker of this Scheduler.
Once the Worker is no longer in use, one should call dispose() on it to
release any resources the particular Scheduler may have used.
It depends on the implementation, but Scheduler Workers should usually run tasks in
FIFO order. Some implementations may entirely delegate the scheduling to an
underlying structure (like an | |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides default reactor. Doc from reactor. Instructs this Scheduler to release all resources and reject any new tasks to be executed. The operation is thread-safe. The Scheduler may choose to ignore this instruction. When used in combination with
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Overrides default reactor. Doc from reactor. Optionally return true when the resource or task is disposed. Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.
| |
| scanUnsafe | back to summary |
|---|---|
| public Object scanUnsafe(Scannable. Implements reactor. Doc from reactor. This method is used internally by components to define their key-value mappings
in a single place. Although it is ignoring the generic type of the
For public consumption of attributes, prefer using | |
| schedule | back to summary |
|---|---|
| public Disposable schedule(Runnable task) Implements reactor. Doc from reactor. Schedules the non-delayed execution of the given task on this scheduler. This method is safe to be called from multiple threads but there are no ordering guarantees between tasks.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
Since Executor doesn't have cancellation support of its own, the ExecutorRunnable will stay in the Executor's queue and be always executed.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| pack-priv final Runnable |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Implements reactor. |
| public boolean | isDisposed()
Overrides default reactor. |
| public void |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| task | back to summary |
|---|---|
| pack-priv final Runnable task | |
| ExecutorPlainRunnable | back to summary |
|---|---|
| pack-priv ExecutorPlainRunnable(Runnable task) | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements reactor. Doc from reactor. Cancel or dispose the underlying task or resource. Implementations are required to make this method idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Overrides default reactor. Doc from reactor. Optionally return true when the resource or task is disposed. Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.
| |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Executor | |
| pack-priv final Queue | |
| pack-priv volatile boolean | |
| pack-priv volatile int | |
| pack-priv static final AtomicIntegerFieldUpdater | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | dispose()
Implements reactor. |
| public boolean | isDisposed()
Overrides default reactor. |
| public void | |
| public Object | scanUnsafe(Scannable.
a keyAttr to resolve for the component.Implements reactor. |
| public Disposable | schedule(Runnable
the task to schedule task)Implements reactor. |
| executor | back to summary |
|---|---|
| pack-priv final Executor executor | |
| queue | back to summary |
|---|---|
| pack-priv final Queue<ExecutorScheduler. | |
| terminated | back to summary |
|---|---|
| pack-priv volatile boolean terminated | |
| wip | back to summary |
|---|---|
| pack-priv volatile int wip | |
| WIP | back to summary |
|---|---|
| pack-priv static final AtomicIntegerFieldUpdater<ExecutorScheduler. | |
| wrapSchedule | back to summary |
|---|---|
| private final boolean wrapSchedule | |
| ExecutorSchedulerTrampolineWorker | back to summary |
|---|---|
| pack-priv ExecutorSchedulerTrampolineWorker(Executor executor) | |
| delete | back to summary |
|---|---|
| public void delete(ExecutorScheduler. Implements reactor.
| |
| dispose | back to summary |
|---|---|
| public void dispose() Implements reactor. Doc from reactor. Cancel or dispose the underlying task or resource. Implementations are required to make this method idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Overrides default reactor. Doc from reactor. Optionally return true when the resource or task is disposed. Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.
| |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| scanUnsafe | back to summary |
|---|---|
| public Object scanUnsafe(Scannable. Implements reactor. Doc from reactor. This method is used internally by components to define their key-value mappings
in a single place. Although it is ignoring the generic type of the
For public consumption of attributes, prefer using | |
| schedule | back to summary |
|---|---|
| public Disposable schedule(Runnable task) Implements reactor. Doc from reactor. Schedules the task for immediate execution on this worker.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Executor | |
| pack-priv final Disposable. | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | dispose()
Implements reactor. |
| public boolean | isDisposed()
Overrides default reactor. |
| public Object | scanUnsafe(Scannable.
a keyAttr to resolve for the component.Implements reactor. |
| public Disposable | schedule(Runnable
the task to schedule task)Implements reactor. |
| executor | back to summary |
|---|---|
| pack-priv final Executor executor | |
| tasks | back to summary |
|---|---|
| pack-priv final Disposable. | |
| wrapSchedule | back to summary |
|---|---|
| private final boolean wrapSchedule | |
| ExecutorSchedulerWorker | back to summary |
|---|---|
| pack-priv ExecutorSchedulerWorker(Executor executor) | |
| delete | back to summary |
|---|---|
| public void delete(ExecutorScheduler. Implements reactor.
| |
| dispose | back to summary |
|---|---|
| public void dispose() Implements reactor. Doc from reactor. Cancel or dispose the underlying task or resource. Implementations are required to make this method idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Overrides default reactor. Doc from reactor. Optionally return true when the resource or task is disposed. Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.
| |
| scanUnsafe | back to summary |
|---|---|
| public Object scanUnsafe(Scannable. Implements reactor. Doc from reactor. This method is used internally by components to define their key-value mappings
in a single place. Although it is ignoring the generic type of the
For public consumption of attributes, prefer using | |
| schedule | back to summary |
|---|---|
| public Disposable schedule(Runnable task) Implements reactor. Doc from reactor. Schedules the task for immediate execution on this worker.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final boolean | |
| pack-priv final ExecutorScheduler. | |
| private static final long | |
| pack-priv final Runnable |
| Access | Constructor and Description |
|---|---|
| pack-priv | ExecutorTrackedRunnable(Runnable task, ExecutorScheduler.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Implements reactor. |
| public boolean | isDisposed()
Overrides default reactor. |
| public void |
| callRemoveOnFinish | back to summary |
|---|---|
| pack-priv final boolean callRemoveOnFinish | |
| parent | back to summary |
|---|---|
| pack-priv final ExecutorScheduler. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| task | back to summary |
|---|---|
| pack-priv final Runnable task | |
| ExecutorTrackedRunnable | back to summary |
|---|---|
| pack-priv ExecutorTrackedRunnable(Runnable task, ExecutorScheduler. | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements reactor. Doc from reactor. Cancel or dispose the underlying task or resource. Implementations are required to make this method idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Overrides default reactor. Doc from reactor. Optionally return true when the resource or task is disposed. Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.
| |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| delete | back to summary |
|---|---|
| public void delete(ExecutorScheduler. | |