简体   繁体   中英

What is the purpose of TaskExecutor in spring?

What is the purpose of TaskExecutor in spring. What problem does it solve ? How is it different from Executors in java concurrent package ?

From http://static.springsource.org/spring/docs/2.0.8/reference/scheduling.html

23.4. The Spring TaskExecutor abstraction

...

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.

...

它是一个接口,其实现包含Java 5+ ExecutorService并为缺少java.util.concurrent包的java.util.concurrent Java版本提供实现。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM