[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Composite Map key and weak reference

jason.greene@jboss.com do-not-reply at jboss.com
Tue May 20 10:52:58 EDT 2008


"bstansberry at jboss.com" wrote : Oh, but my class above is intended to be passed as a key to WeakHashMap.  The ReferenceQueue polling will remove the only strong ref to the Key, at which point the WeakHashMap will do its normal thing and make the Key/value pair eligible for removal.

IMO it would be better to connect the logic to the map, then the entry is cleared in one pass, and you aren't tied to a particular map implementation.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4152047#4152047

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4152047



More information about the jboss-dev-forums mailing list