Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Operating System: All
Platform: All
-
38664
Description
Attached are the pool 2.0 changes I'd like to see to the PoolableObjectFactory
and the KeyedPoolableObjectFactory interfaces. The noteworthy changes are:
- activateObject is to be invoked on previously idle objects, not object created
with makeObject.
- validateObject is to only be invoked on "active" objects. validateObject will
be called before the pool returns a borrowed object. The pool may call
validateObject when objects are being returned to the pool or by and idle
eviction code.
- no guarantee about the condition of objects passed to destroyObject method.
They could be active, passive, valid, or invalid.
- PoolableObjectFactorys must be thread-safe. The only promise an ObjectPool
makes is that the same instance of an object will not be passed to more than one
method of a PoolableObjectFactorys at a time.
For the last item I think we should provide a synchronization wrapper for
PoolableObjectFactorys much like java.util.Collections has a
synchronizedCollection method.