Top Description Methods
org.springframework.core.task

public Interface TaskExecutor

extends Executor
Known Direct Subinterfaces
org.springframework.core.task.AsyncTaskExecutor
Known Direct Implementers
org.springframework.core.task.SyncTaskExecutor
Annotations
@FunctionalInterface
Imports
java.util.concurrent.Executor

Simple task executor interface that abstracts the execution of a Runnable.

Implementations can use all sorts of different execution strategies, such as: synchronous, asynchronous, using a thread pool, and more.

Equivalent to Java's java.util.concurrent.Executor interface, so that clients may declare a dependency on an Executor and receive any TaskExecutor implementation. This interface remains separate from the standard Executor interface primarily for backwards compatibility with older APIs that depend on the TaskExecutor interface.

Author
Juergen Hoeller
Since
2.0
See Also
java.util.concurrent.Executor

Method Summary

Modifier and TypeMethod and Description
public void
execute(Runnable
the Runnable to execute (never null)
task
)

Redeclares java.util.concurrent.Executor.execute.

Execute the given task.

Method Detail

executeback to summary
public void execute(Runnable task)

Redeclares java.util.concurrent.Executor.execute.

Execute the given task.

The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.

Parameters
task:Runnable

the Runnable to execute (never null)

Annotations
@Override
Exceptions
TaskRejectedException:
if the given task was not accepted