[emf] question regarding ResourceSetImpl#uriResourceMap [message #760170] |
Thu, 01 December 2011 09:19  |
Eclipse User |
|
|
|
Hi,
What is the reason behind updating the ResourceSetImpl#uriResourceMap in
ResourceSetImpl$ResourcesEList#inverseRemove() but not in
ResourceSetImpl$ResourcesEList#inverseAdd() ?
A client will typically not add a resource the the ResourceSet#getResources()
list manually, but is it an error to do so?
Background: I am working on an application processing a large set of resources
(too large to all fit at once). The application loads and processes the
resources one at the time and periodically clears the ResourceSet of all
resources (e.g. every 20 resources). Due to cross references a resource may
end up being loaded many times before the processing finishes. To avoid that
as much as possible (performance is another main concern) the idea was to
implement a custom ResourceSet which maintains a SoftReference cache of
"unused" resources. The ResourceSet would move resources to that cache as soon
as they are removed (i.e. in ResourceSetImpl$ResourcesEList#inverseRemove())
and would load them into the resources list again in
ResourceSetImpl#delegatedGetResource(). That's when I stumbled over this
asymmetry.
Regards,
--knut
|
|
|
Re: [emf] question regarding ResourceSetImpl#uriResourceMap [message #760172 is a reply to message #760170] |
Thu, 01 December 2011 09:20  |
Eclipse User |
|
|
|
Sorry, wrong list...
On 12/1/11 3:19 PM, Knut Wannheden wrote:
> Hi,
>
> What is the reason behind updating the ResourceSetImpl#uriResourceMap in
> ResourceSetImpl$ResourcesEList#inverseRemove() but not in
> ResourceSetImpl$ResourcesEList#inverseAdd() ?
>
> A client will typically not add a resource the the ResourceSet#getResources()
> list manually, but is it an error to do so?
>
> Background: I am working on an application processing a large set of resources
> (too large to all fit at once). The application loads and processes the
> resources one at the time and periodically clears the ResourceSet of all
> resources (e.g. every 20 resources). Due to cross references a resource may
> end up being loaded many times before the processing finishes. To avoid that
> as much as possible (performance is another main concern) the idea was to
> implement a custom ResourceSet which maintains a SoftReference cache of
> "unused" resources. The ResourceSet would move resources to that cache as soon
> as they are removed (i.e. in ResourceSetImpl$ResourcesEList#inverseRemove())
> and would load them into the resources list again in
> ResourceSetImpl#delegatedGetResource(). That's when I stumbled over this
> asymmetry.
>
> Regards,
>
> --knut
|
|
|
Powered by
FUDForum. Page generated in 0.04254 seconds