问题描述
春季TaskExecutor的用途是什么。它解决什么问题?
What is the purpose of TaskExecutor in spring. What problem does it solve ? How is it different from Executors in java concurrent package ?
推荐答案
来自
23.4。 Spring TaskExecutor抽象
23.4. The Spring TaskExecutor abstraction
...
Spring的TaskExecutor接口与java.util相同.concurrent.Executor接口。实际上,其存在的主要原因是在使用线程池时抽象出对Java 5的需求。接口具有单个方法execute(Runnable task),该方法根据语义和配置来接受要执行的任务
Spring's TaskExecutor interface is identical to the java.util.concurrent.Executor interface. In fact, its primary reason for existence is to abstract away the need for Java 5 when using thread pools. The interface has a single method execute(Runnable task) that accepts a task for execution based on the semantics and configuration of the thread pool.
...
这篇关于春天的TaskExecutor的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!