public class SyncTaskExecutor extends java.lang.Object implements TaskExecutor, java.io.Serializable
TaskExecutor implementation that executes each task synchronously
in the calling thread.
Mainly intended for testing scenarios.
Execution in the calling thread does have the advantage of participating
in it's thread context, for example the thread context class loader or the
thread's current transaction association. That said, in many cases,
asynchronous execution will be preferable: choose an asynchronous
TaskExecutor instead for such scenarios.
SimpleAsyncTaskExecutor,
Serialized Form| Constructor and Description |
|---|
SyncTaskExecutor() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(java.lang.Runnable task)
Executes the given
task synchronously, through direct
invocation of it's run() method. |
public void execute(java.lang.Runnable task)
task synchronously, through direct
invocation of it's run() method.execute in interface java.util.concurrent.Executorexecute in interface TaskExecutortask - the Runnable to execute (never null)java.lang.IllegalArgumentException - if the given task is null