References Deprecated
AsyncListenableTaskExecutor is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
java.util.concurrent.Executor and exposes
a Spring org.springframework.core.task.TaskExecutor for it.
Also detects an extended java.util.concurrent.ExecutorService, adapting
the org.springframework.core.task.AsyncTaskExecutor interface accordingly.
Autodetects a JSR-236 jakarta.
in order to expose jakarta. adapters for it,
exposing a long-running hint based on SchedulingAwareRunnable and an identity
name based on the given Runnable/Callable's toString(). For JSR-236 style
lookup in a Jakarta EE environment, consider using DefaultManagedTaskExecutor.
Note that there is a pre-built ThreadPoolTaskExecutor that allows
for defining a java. in bean style,
exposing it as a Spring org. directly.
This is a convenient alternative to a raw ThreadPoolExecutor definition with
a separate definition of the present adapter class.
java.util.concurrent.Executor , java.util.concurrent.ExecutorService , java.util.concurrent.ThreadPoolExecutor , java.util.concurrent.Executors , DefaultManagedTaskExecutor, ThreadPoolTaskExecutor
| Modifier and Type | Class and Description |
|---|---|
| protected static class | ConcurrentTaskExecutor.
Delegate that wraps a given Runnable/Callable with a JSR-236 ManagedTask,
exposing a long-running hint based on |
| private static class | ConcurrentTaskExecutor.
References Deprecated
TaskExecutorAdapter subclass that wraps all provided Runnables and Callables
with a JSR-236 ManagedTask, exposing a long-running hint based on
TaskExecutorAdapter is deprecated or references (maybe indirectly) at least one deprecated element.
SchedulingAwareRunnable and an identity name based on the task's
toString() representation.
|
| Modifier and Type | Field and Description |
|---|---|
| private TaskExecutorAdapter | adaptedExecutor
References Deprecated
TaskExecutorAdapter is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private Executor | |
| private static Class | |
| private static final Executor | |
| private TaskDecorator |
| Access | Constructor and Description |
|---|---|
| public | ConcurrentTaskExecutor()
Deprecated
since 6.1. in favor of
ConcurrentTaskExecutor(Executor) with an
externally provided Executor
Create a new ConcurrentTaskExecutor, using a single thread executor as default. |
| public | ConcurrentTaskExecutor(Executor
the executor)java. to delegate toCreate a new ConcurrentTaskExecutor, using the given |
| Modifier and Type | Method and Description |
|---|---|
| public void | execute(Runnable
the task)Runnable to execute (never null)Implements org. Execute the given |
| public void | execute(Runnable
the task, long Runnable to execute (never null)the time duration (milliseconds) within which the task is
supposed to start. This is intended as a hint to the executor, allowing for
preferred handling of immediate tasks. Typical values are startTimeout)TIMEOUT_IMMEDIATE
or TIMEOUT_INDEFINITE (the default as used by execute(Runnable)).Overrides default org.
Deprecated
Execute the given |
| private TaskExecutorAdapter | getAdaptedExecutor(Executor concurrentExecutor)
References Deprecated
TaskExecutorAdapter is deprecated or references (maybe indirectly) at least one deprecated element.
|
| public final Executor | |
| public final void | |
| public final void | setTaskDecorator(TaskDecorator taskDecorator)
Specify a custom |
| public Future | submit(Runnable
the task)Runnable to execute (never null)Overrides default org. Submit a Runnable task for execution, receiving a Future representing that task. |
| public <T> Future | submit(Callable<T>
the task)Callable to execute (never null)Overrides default org. Submit a Callable task for execution, receiving a Future representing that task. |
| public ListenableFuture | submitListenable(Runnable
the task)Runnable to execute (never null)Implements org.
References Deprecated
ListenableFuture is deprecated or references (maybe indirectly) at least one deprecated element.
Submit a |
| public <T> ListenableFuture | submitListenable(Callable<T>
the task)Callable to execute (never null)Implements org.
References Deprecated
ListenableFuture is deprecated or references (maybe indirectly) at least one deprecated element.
Submit a |
| adaptedExecutor | back to summary |
|---|---|
| private TaskExecutorAdapter adaptedExecutor
References Deprecated
See corresponding docs for further information. | |
| concurrentExecutor | back to summary |
|---|---|
| private Executor concurrentExecutor | |
| managedExecutorServiceClass | back to summary |
|---|---|
| private static Class<?> managedExecutorServiceClass
| |
| STUB_EXECUTOR | back to summary |
|---|---|
| private static final Executor STUB_EXECUTOR | |
| taskDecorator | back to summary |
|---|---|
| private TaskDecorator taskDecorator
| |
| ConcurrentTaskExecutor | back to summary |
|---|---|
| public ConcurrentTaskExecutor()
Deprecated since 6.1. in favor of Create a new ConcurrentTaskExecutor, using a single thread executor as default.
| |
| ConcurrentTaskExecutor | back to summary |
|---|---|
| public ConcurrentTaskExecutor(Executor executor) Create a new ConcurrentTaskExecutor, using the given Autodetects a JSR-236
| |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Implements org. Doc from org. Execute the given The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution. | |
| execute | back to summary |
|---|---|
| public void execute(Runnable task, long startTimeout) Overrides default org. Doc from org. Deprecated
Execute the given As of 6.1, this method comes with a default implementation that simply
delegates to
| |
| getAdaptedExecutor | back to summary |
|---|---|
| private TaskExecutorAdapter getAdaptedExecutor(Executor concurrentExecutor)
References Deprecated
See corresponding docs for further information. | |
| getConcurrentExecutor | back to summary |
|---|---|
| public final Executor getConcurrentExecutor() Return the | |
| setConcurrentExecutor | back to summary |
|---|---|
| public final void setConcurrentExecutor(Executor executor) Specify the Autodetects a JSR-236 | |
| setTaskDecorator | back to summary |
|---|---|
| public final void setTaskDecorator(TaskDecorator taskDecorator) Specify a custom Note that such a decorator is not necessarily being applied to the
user-supplied The primary use case is to set some execution context around the task's invocation, or to provide some monitoring/statistics for task execution. Note Exception handling in
| |
| submit | back to summary |
|---|---|
| public Future Overrides default org. Doc from org. Submit a Runnable task for execution, receiving a Future representing that task.
The Future will return a As of 6.1, this method comes with a default implementation that delegates
to | |
| submit | back to summary |
|---|---|
| public <T> Future Overrides default org. Doc from org. Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion. As of 6.1, this method comes with a default implementation that delegates
to | |
| submitListenable | back to summary |
|---|---|
| public ListenableFuture Implements org. Doc from org. References Deprecated
See corresponding docs for further information. Submit a
| |
| submitListenable | back to summary |
|---|---|
| public <T> ListenableFuture Implements org. Doc from org. References Deprecated
See corresponding docs for further information. Submit a
| |
SchedulingAwareRunnable
and a given identity name.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static Runnable | |
| public static <T> Callable |
| ManagedTaskBuilder | back to summary |
|---|---|
| protected ManagedTaskBuilder() | |
| buildManagedTask | back to summary |
|---|---|
| public static Runnable buildManagedTask(Runnable task, String identityName) | |
| buildManagedTask | back to summary |
|---|---|
| public static <T> Callable | |
References Deprecated
TaskExecutorAdapter is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
SchedulingAwareRunnable and an identity name based on the task's
toString() representation.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | execute(Runnable
the task)Runnable to execute (never null)Overrides org. Implements org. Delegates to the specified JDK concurrent executor. |
| public Future | submit(Runnable
the task)Runnable to execute (never null)Overrides org. Overrides default org. Submit a Runnable task for execution, receiving a Future representing that task. |
| public <T> Future | submit(Callable<T>
the task)Callable to execute (never null)Overrides org. Overrides default org. Submit a Callable task for execution, receiving a Future representing that task. |
| public ListenableFuture | submitListenable(Runnable
the task)Runnable to execute (never null)Overrides org. Implements org.
References Deprecated
ListenableFuture is deprecated or references (maybe indirectly) at least one deprecated element.
Submit a |
| public <T> ListenableFuture | submitListenable(Callable<T>
the task)Callable to execute (never null)Overrides org. Implements org.
References Deprecated
ListenableFuture is deprecated or references (maybe indirectly) at least one deprecated element.
Submit a |
| ManagedTaskExecutorAdapter | back to summary |
|---|---|
| public ManagedTaskExecutorAdapter(Executor concurrentExecutor) | |
| execute | back to summary |
|---|---|
| public void execute(Runnable task) Overrides org. Implements org. Doc from org. Delegates to the specified JDK concurrent executor.
| |
| submit | back to summary |
|---|---|
| public Future Overrides org. Overrides default org. Doc from org. Submit a Runnable task for execution, receiving a Future representing that task.
The Future will return a As of 6.1, this method comes with a default implementation that delegates
to | |
| submit | back to summary |
|---|---|
| public <T> Future Overrides org. Overrides default org. Doc from org. Submit a Callable task for execution, receiving a Future representing that task. The Future will return the Callable's result upon completion. As of 6.1, this method comes with a default implementation that delegates
to | |
| submitListenable | back to summary |
|---|---|
| public ListenableFuture Overrides org. Implements org. Doc from org. References Deprecated
See corresponding docs for further information. Submit a
| |
| submitListenable | back to summary |
|---|---|
| public <T> ListenableFuture Overrides org. Implements org. Doc from org. References Deprecated
See corresponding docs for further information. Submit a
| |