| Summary: | TocServlet responseByLocale cache cannot be cleared programatically | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jim Perry <perryja> | ||||||
| Component: | User Assistance | Assignee: | Chris Austin <ChrisAustin> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cgold, ChrisAustin | ||||||
| Version: | 4.0 | ||||||||
| Target Milestone: | 3.7 M5 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Jim Perry
Created attachment 179914 [details]
Patch for adding method to set the toc cache invalid which forces a refresh
This path provides the method:
public static void setCacheInvalid()
{
cacheInvalid=true;
}
So the toc cache can be forced to refresh if changes to the toc have been made.
The variable is added to the check for determine if a new HashMap is needed.
if (responseByLocale == null || cacheInvalid) {
responseByLocale = new WeakHashMap();
}
Are you looking to create API so that an application which extends Eclipse can clear this cache? If so you would need to add the method to an API class - TocServlet is internal. The other problem with the patch is that once cacheInvalid is false it never gets reset to being true. Hi Chris, Thanks for the response. I agree an API class would be better. Is there an an API class I can use as an example? Is there an existing API class that this method would make sense to go in? Also, the cacheInvalid does need to be set to true as you said. So I think the public API might look someything like this: org.eclipse.help.webapp: org.eclipse.help.webapp.TocSystem TocSystem has a method, clearTocCache which calls the TocServlet.setCacheInvalid() method. *** Bug 280457 has been marked as a duplicate of this bug. *** Created attachment 187031 [details]
Patch - Public API Version
I took a quick look at the patch and the API looks good. One thing we should think about is making this code thread safe - the current code is not perfect in that respect. I'm still trying to understand the initial requirement. Currently the help system works on the assumption that the table of contents does not change after it is first built and the TocServlet is just one instance of that assumption. (In reply to comment #7) > I took a quick look at the patch and the API looks good. One thing we should > think about is making this code thread safe - the current code is not perfect > in that respect. Yeah - I was thinking the same, but I did not have time to come up with a solution for it. > I'm still trying to understand the initial requirement. Currently the help > system works on the assumption that the table of contents does not change after > it is first built and the TocServlet is just one instance of that assumption. The requirement is for doc installs. We need a way to update the Table of Contents after new doc has been installed, without restarting the help system. Internally, we have been using a clear cache patch on the org.eclipse.help.webapp plugin and it has been very helpful in refreshing the toc after new content has been installed. Patch committed to HEAD |