Martin Desruisseaux ha scritto:
<snip>
> 
> The problem is that the scans of the registry can change the registry 
> state as well. The factory are not loaded at FactoryRegistry creation, 
> but delayed until a scan is performed for a given category. The state 
> may also change if a factory iterator were added or removed since the 
> last scan, etc.
> 
> However if we implement the cache you are suggesting, we could look in 
> the cache first in a non-synchronized block (maybe using 
> ConcurrentHashMap or some similar mechanism), then synchronize only if 
> no suitable factory were found in the cache.

I see. Yet, say I cache the results. I can use a (Class, Hints) key
for the cache, but what about being notified that a new factory
iterator has been added since the last scan? Otherwise the cache
would contain stale results, wouldn't it?

Cheers
Andrea

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to