ExecutorService lifecycle management
with pause/resume support.
ExecutorConfigurationSupport, SimpleAsyncTaskScheduler
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final ExecutorService | |
| private volatile boolean | |
| private final Lock | |
| private volatile boolean | |
| private Runnable | |
| private final Condition |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void | |
| public boolean | isRunning()
Implements org. Check whether this component is currently running. |
| pack-priv void | |
| public void | |
| public void | stop()
Implements org. Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method. |
| public void | stop(Runnable callback)
Overrides default org. Indicates that a Lifecycle component must stop if it is currently running. |
| executingTaskCount | back to summary |
|---|---|
| private int executingTaskCount | |
| executor | back to summary |
|---|---|
| private final ExecutorService executor | |
| paused | back to summary |
|---|---|
| private volatile boolean paused | |
| pauseLock | back to summary |
|---|---|
| private final Lock pauseLock | |
| shutdown | back to summary |
|---|---|
| private volatile boolean shutdown | |
| stopCallback | back to summary |
|---|---|
| private Runnable stopCallback
| |
| unpaused | back to summary |
|---|---|
| private final Condition unpaused | |
| ExecutorLifecycleDelegate | back to summary |
|---|---|
| public ExecutorLifecycleDelegate(ExecutorService executor) | |
| afterExecute | back to summary |
|---|---|
| pack-priv void afterExecute() | |
| beforeExecute | back to summary |
|---|---|
| pack-priv void beforeExecute(Thread thread) | |
| isRunning | back to summary |
|---|---|
| public boolean isRunning() Implements org. Doc from org. Check whether this component is currently running. In the case of a container, this will return
| |
| markShutdown | back to summary |
|---|---|
| pack-priv void markShutdown() | |
| start | back to summary |
|---|---|
| public void start() Implements org. Doc from org. Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate the start signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Should not throw an exception if the component is not running (not started yet). In the case of a container, this will propagate the stop signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public void stop(Runnable callback) Overrides default org. Doc from org. Indicates that a Lifecycle component must stop if it is currently running. The provided callback is used by the The The default implementation delegates to
| |