类 SyncTaskExecutor
java.lang.Object
cn.taketoday.core.task.SyncTaskExecutor
- 所有已实现的接口:
TaskExecutor,Serializable,Executor
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.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
构造器概要
构造器 -
方法概要
-
构造器详细资料
-
SyncTaskExecutor
public SyncTaskExecutor()
-
-
方法详细资料
-
execute
Executes the giventasksynchronously, through direct invocation of it'srun()method.- 指定者:
execute在接口中Executor- 指定者:
execute在接口中TaskExecutor- 参数:
task- theRunnableto execute (nevernull)- 抛出:
IllegalArgumentException- if the giventaskisnull
-