Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [emf] question regarding ResourceSetImpl#uriResourceMap
[emf] question regarding ResourceSetImpl#uriResourceMap [message #760170] Thu, 01 December 2011 14:19 Go to next message
Knut Wannheden is currently offline Knut WannhedenFriend
Messages: 298
Registered: July 2009
Senior Member
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 14:20 Go to previous message
Knut Wannheden is currently offline Knut WannhedenFriend
Messages: 298
Registered: July 2009
Senior Member
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
Previous Topic:How do I write a search-path based scope?
Next Topic:Why can't I use terminals like this? ('missing EOF at' - error)
Goto Forum:
  


Current Time: Tue Apr 16 23:23:40 GMT 2024

Powered by FUDForum. Page generated in 1.81823 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top