views:

824

answers:

1

It's my understanding that in Spring, all objects are treated by default as singletons. If singleton is set to false, then a new object will be served at each request.

But what if I wanted to pool objects? Say set a range from a min of 1 to a max of 10 instances? Is this possible using Spring?

+5  A: 

Pooling can be applied to any POJO with spring.

See here for more information.

toolkit
+1 I think the real work here is being done by commons-pool, but this sounds like a good way to enable it
matt b
This is the sort of thing that makes Spring cool - take an off-the-shelf, best-of-breed open source library, and wrap it so that you can use it the same IoC way as everything else. Sweet.
skaffman
That's excellent. Thank you.
Cuga