
Originally Posted by
dnlchou
Hello,
I am wondering whether spring framework has any build-in thread pool mechanism which I can use in my application for thread management. If yes, where can I find the related information? Thanks a lot.
Spring doesn`t provide threadpoolmanagement as far as I know of. There are different solutions:
1) you could write it yourself 
2) you could use Quartz. Quartz is a scheduler for Java and if you need Scheduling, then Quartz could be a solution. Quartz gives you control on the threadpools being used for executing jobs.
3) you could use the ScheduledThreadPoolExecutor that is part of java 5.0. I`m currently writing some Springbeans that make using the ScheduledThreadPoolExecutor easier. There also is a java 1.4 backport of the concurrency library. If you need scheduling, this could be a alternative to 2.
4) use the ThreadPoolExecutor that is part of java 5.
But what do you need? Do you need scheduling? Or do you want to have control on the resources that are executed? I`m thinking about writing a Spring plugin for the last one: it wraps a service and provided threadmanagement, eg:
Code:
@Active(priority=2,poolSize=10)
class SomeService{
void doSomethingHeavy(){....}
}