Is there any generic version of the shared pool of Apache objects?

When using the Apache shared pool, it can provide me with a good implementation of the Java object pool. However, their KeyedPoolableObjectFactory interface is not type safe. Is there any object pool library in Java that can provide a common interface for creating a pool of safe type objects?

+4
source share
2 answers

Apache Commons Pool version 1.6 supports generics

http://commons.apache.org/pool/examples.html

+4
source

Not as far as I know, but it’s easy enough to create a typed wrapper around a community pool implementation, so your calling code can use generics.

+2
source

All Articles