Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » URIResolverExtension and caching
URIResolverExtension and caching [message #116346] Tue, 05 July 2005 10:02 Go to next message
Eclipse UserFriend
Hi,

I'm not sure whether this is my weak java foo or if this is actually an
eclipse wtp question. I implement a
org.eclipse.wst.common.uriresolver.internal.provisional.URIR esolverExtension
in my plugin, and I would like to cache some of the computed values.

The values are project specific, so I had some hash for (project, uri)
-> uri. Now my real question is, how do I do that with a sane balance of
performance and memory bloat/leak.

I was thinking about some kind of shared instance like plugin classes
have, but I'm a bit worried how those get teared down again. And is
there a good way to know which hash entries to prune and when?

Yeah, fuzzy description, but it sounds like something that others did a
dozens of times, thus I ask

Thanks

Axel
Re: URIResolverExtension and caching [message #116455 is a reply to message #116346] Tue, 05 July 2005 16:29 Go to previous message
Eclipse UserFriend
Hi Axel,

The org.eclipse.wst.internet.cache URI resolver does something similar.
You can implement your cache as a singleton (see
http://www.dofactory.com/Patterns/PatternSingleton.aspx) and associate an
expiration time with each entry. In that way you have one instance of your
cache and you can prune dead entires. You can also have your plugin clear
all the entries when your plugin is deactivated or store them for use the
next time Eclipse is run.

Lawrence
Previous Topic:When is the flexible project getting a UI for existing projects?
Next Topic:Question on Top down web service creation
Goto Forum:
  


Current Time: Tue Apr 29 18:36:38 EDT 2025

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

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

Back to the top