[ 
https://issues.apache.org/jira/browse/WICKET-3948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080868#comment-13080868
 ] 

Martin Grigorov commented on WICKET-3948:
-----------------------------------------

#getResource() is used also by ResourceMapper to map the correct 
ResRef+Resource (see line 156 in current trunk). It would be nice if the 
returned resource is used both for #equals() check and for the caching.

Additionally I see in the patch:
if (Strings.isEmpty(cacheUrl.getFileName()))
+                               {
+                                       throw new 
IllegalStateException("caching strategy returned empty name for " + resource);
+                               }
Recently Dashorst improved BasicResourceReferenceMapper to return null and log 
a debug message instead. 
Update: I saw that you actually reverted his change. Why ?!

In AbstractResource
private IResourceCachingStrategy getCachingStrategy()
make it protected to be more flexible - use per resource caching strategy, be 
able to test Resource without the need to have Application in the thread local 
context.


> IResourceCachingStrategy is too much bound to PackageResource, make it more 
> general
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-3948
>                 URL: https://issues.apache.org/jira/browse/WICKET-3948
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 1.5-RC5.1
>            Reporter: Peter Ertl
>            Assignee: Peter Ertl
>         Attachments: cache3.patch
>
>
> Somebody recently complained on the wicket userlist that 
> IResourceCachingStrategy is not very versatile but only useable for 
> PackageResources. I 100% agree would like to generalize the caching part by 
> introducing the interface 'ICacheableResourceReference' (instead of referring 
> to PackageResource). This makes it easy to use caching for other resource 
> types. Since we are so close to 1.5 I would like to ask first if the patch is 
> acceptable by you.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to