History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CACHE-162
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Lars Torunski
Reporter: Lars Torunski
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OSCache
CacheFilter easier sub-classing (CACHE-141)

CacheFilter easier sub-classing via useCache

Created: 10/Apr/05 06:56 AM   Updated: 26/Feb/07 01:45 PM
Component/s: Filters
Affects Version/s: 2.1
Fix Version/s: 2.4


 Description  « Hide
It would be nice to add some improvements to the CacheFilter class in order to make it easier to have a sub-class.

Another good point would be to have a method called to decide whether a cache entry sould be used or not.

/**
     * useCache is a method allowing subclass to decide if the use
     * of the cache is requested or not.
     *
     * @param request The HTTP servlet request
     * @param response The HTTP servlet response
     * @param key The cache key used to access the cache
     * @param cache The cache object
     * @return Returns a boolean indicating if the caching is requested or not.
     */
    protected boolean useCache(HttpServletRequest request,
                               HttpServletResponse response,
                               String key,
                               Cache cache) {
        boolean useIt = true ;

if (log.isDebugEnabled()) {
            log.debug("<cache>: the cache " + ((useIt) ? "will" : "will not") + " be used.");
        }
        return useIt ;
    }

 All   Comments   Change History      Sort Order:
There are no comments yet on this issue.