Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316115

Summary: Cache resources returned by IResourceLocator
Product: z_Archived Reporter: Marcel Stör <marcel>
Component: BIRTAssignee: Yu Chen <yChen>
Status: CLOSED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier, rlu, wenfeng.fwd, wyan, yli
Version: 2.5.2   
Target Milestone: 3.7.0   
Hardware: All   
OS: All   
Whiteboard:

Description Marcel Stör CLA 2010-06-08 07:58:58 EDT
I noticed that my implementation of org.eclipse.birt.report.model.api.IResourceLocator#findResource() is called dozens of times for one and the same resource (images,
resource bundle properties, javascript/JARs referenced in the .rptdesign
files).

I expect that BIRT uses a cache for such resources.
Comment 1 Marcel Stör CLA 2010-06-08 08:02:13 EDT
Discussion was started here: http://www.eclipse.org/forums/index.php?t=msg&th=169329&start=0&
Comment 2 Jun Ouyang CLA 2010-08-06 03:45:10 EDT
It's better for user to do cache in the implementation of IResourceLocator.
Comment 3 Marcel Stör CLA 2010-08-06 03:58:53 EDT
Sorry, I must insist. Look at the signature of IResourceLocator and you'll notice that clients have to chance to cache resources:

http://www.birt-exchange.com/be/documentation/BIRT_220/EngineJavadoc/model/api/org/eclipse/birt/report/model/api/IResourceLocator.html#findResource%28org.eclipse.birt.report.model.api.ModuleHandle,%20java.lang.String,%20int%29

IResourceLocator returns a URL i.e. it's just a pointer to a resource. We already cache URL resolutions based on names but that's as much as we can do.
Comment 4 Wenfeng Li CLA 2011-01-19 17:20:23 EST
schedule to Indigo release to investigate.
Comment 5 Yu Chen CLA 2011-05-16 05:25:19 EDT
Fixed.