On 8/8/13 10:20 PM, pste...@apache.org wrote: > Author: psteitz > Date: Fri Aug 9 05:20:37 2013 > New Revision: 1512140 > > URL: http://svn.apache.org/r1512140 > Log: > Eliminated PoolableObjectFactory, KeyedPoolableObjectFactory and replaced > them with PooledObjectFactory, KeyedPooledObjectFactory, the (formerly) > subclasses that create and operate on PooledObjects. Similarly replaced the > base factories with PooledObject versions. Modified SoftReferenceObjectPool > to manage PooledObjects. > > Thanks in advance for careful review - especially SoftReferenceObjectPool changes. I tried to preserve the original semantics of the class, but I am honestly not sure that is needed / best. In particular, the original version always cleared references to objects when they were checked out. To be able to track objects via soft references, I needed to create new (unregistered) references to the objects being checked out and make the PooledSoftReferences mutable. I am not sure this is necessary - i.e., we could just leave the queued references in allReferences. If a client is holding a hard reference to an object, a soft reference to it should not get queued, so I don't see why we need to explicitly prevent it. I also did not fix the over-synchronization and violation of our invariant that factory methods are not called in sync scope in that class. One thing I did change is I added a check similar to what GOP has for an object belonging to the pool on return. This will hurl on objects whose references have been cleared, but unless I am missing something, this is not really a logical possibility. I am no expert on GC, so it is quite possible I have this wrong, so please enlighten me if I do. Finally, I did not add JMX instrumentation. I would be OK holding on all of these to 2.1, but will work on the JMX stuff next. All DBCP tests pass with no change to the code in trunk other than dropping the unused imports.
Phil --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org