You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently a gap in functionality between ThreadPoolTaskExecutor, which is offers lots of ways of configuring a ThreadPoolExecutor but hides it behind a TaskExecutor facade, and SheduledExecutorFactoryBean, which generates a ScheduledThreadPoolExecutor and is a FactoryBean.
It feels like these two should be brought together somehow. I've created a subclass ThreadPoolTaskExecutor which implements FactoryBean and exposes the native ThreadPoolExecutor. I think that SheduledExecutorFactoryBean could itself just be a subclass of ThreadPoolTaskExecutor, but which overrides the method which creates the executor instance.
So, how about a class called ThreadPoolExecutorFactory, which provides facilities for configuring and instantiating ThreadPoolExecutor instances, and then a variety of subclasses of this, including ThreadPoolTaskExecutor (which wraps the ThreadPoolExecutor in a TaskExecutor facade), and ThreadPoolExecutorFactoryBean (which exposes the ThreadPoolExecutor directly). SheduledExecutorFactoryBean would simply become a special case of ThreadPoolExecutorFactoryBean.
Affects: 2.5.6
The text was updated successfully, but these errors were encountered:
I've added a ThreadPoolExecutorFactoryBean (exposing the native ExecutorService API) analogous to ScheduledExecutorFactoryBean (exposing the native ScheduledExecutorService API). Both share a common base class with configuration properties now.
ThreadPoolTaskExecutor continues to exist as a JMX-capable Spring TaskExecutor implementation, using a ThreadPoolExecutor underneath but with different design tradeoffs in terms of being a Spring component.
Note that Spring 3.0 has plenty of further concurrency enhancements: TaskExecutor extends Executor now; AsyncTaskExecutor has "Future submit(Runnable)" and "Future submit(Callable)" methods; we ship an ExecutorServiceAdapter class as a standard wrapper for a Spring TaskExecutor; etc.
Kenny MacLeod opened SPR-5337 and commented
There is currently a gap in functionality between ThreadPoolTaskExecutor, which is offers lots of ways of configuring a ThreadPoolExecutor but hides it behind a TaskExecutor facade, and SheduledExecutorFactoryBean, which generates a ScheduledThreadPoolExecutor and is a FactoryBean.
It feels like these two should be brought together somehow. I've created a subclass ThreadPoolTaskExecutor which implements FactoryBean and exposes the native ThreadPoolExecutor. I think that SheduledExecutorFactoryBean could itself just be a subclass of ThreadPoolTaskExecutor, but which overrides the method which creates the executor instance.
So, how about a class called ThreadPoolExecutorFactory, which provides facilities for configuring and instantiating ThreadPoolExecutor instances, and then a variety of subclasses of this, including ThreadPoolTaskExecutor (which wraps the ThreadPoolExecutor in a TaskExecutor facade), and ThreadPoolExecutorFactoryBean (which exposes the ThreadPoolExecutor directly). SheduledExecutorFactoryBean would simply become a special case of ThreadPoolExecutorFactoryBean.
Affects: 2.5.6
The text was updated successfully, but these errors were encountered: