commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject [PATCH][collections] purging reference map entries when key is garbage collected
Date Wed, 30 Apr 2003 10:28:38 GMT
i'm looking into per context classloader BeanUtilsBean instances. the idea 
is that each web app can have it's own isolated instances (rather than a 
singleton) return on the basis on the thread's contest classloader.

i need a map which holds it's keys with a weak reference and when the key 
is garbage collected, the entry and the value needs to be purged from the 
map. i tested WeakHashMap and it doesn't seem to fit the bill. i tried 
ReferenceMap but this does not purge (hard referenced) values when the key 
is collected.

i've patched ReferenceMap so that it can be setup to do what i need (see 
attachment below).

- robert

View raw message