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.
...
It's an interface whose implementations wrap around Java 5+ ExecutorService and provide implementations for previous versions of Java that are missing the package java.util.concurrent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With