Hi,
for the directory data store I would like to keep
soft references towards data stores to avoid filling
too much the heap in case the directory has many files
(thousands).

The catch is, I need to call dispose() on the datastore
when the reference gets collected away. It seems GeoTools
already has a solution for that, WeakCollectionCleaner
has a private reference queue that it scans and on which
it calls clear() for each enqueued soft reference.

I have one question and one issue:
- when the soft reference gets enqueued, is the
   referenced value still available? (searched on
   the internet, could not find a clear answer to this
   question).
- if so, the weakCollectionCleaner seems like a good
   fit for my needs, but I cannot use it as the
   reference queue is package private. So I would end
   up duplicating the code entirely, which seems wasteful.
   Any change the access to the reference queue can
   be made public?

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to