org.apache.wicket.request.resource.caching
Class AbstractResourceCachingStrategy

java.lang.Object
  extended by org.apache.wicket.request.resource.caching.AbstractResourceCachingStrategy
All Implemented Interfaces:
IResourceCachingStrategy
Direct Known Subclasses:
FilenameWithTimestampResourceCachingStrategy, QueryStringWithTimestampResourceCachingStrategy

public abstract class AbstractResourceCachingStrategy
extends Object
implements IResourceCachingStrategy

base class for resource caching strategies

Author:
Peter Ertl

Field Summary
protected static MetaDataKey<Map<ResourceReference,Time>> TIMESTAMP_KEY
          timestamp cache stored in request cycle meta data (request-scoped)
 
Constructor Summary
AbstractResourceCachingStrategy()
           
 
Method Summary
protected  Time getLastModified(ResourceReference resourceReference)
          That method gets the last modification timestamp from the specified resource reference.
 boolean isLastModifiedCacheEnabled()
          returns if caching if lastModified timestamp lookup is enabled
 void setLastModifiedCacheEnabled(boolean enabled)
          controls request-scoped caching of lookups to last modified time of the resource reference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.request.resource.caching.IResourceCachingStrategy
decorateResponse, decorateUrl, undecorateUrl
 

Field Detail

TIMESTAMP_KEY

protected static final MetaDataKey<Map<ResourceReference,Time>> TIMESTAMP_KEY
timestamp cache stored in request cycle meta data (request-scoped)

Constructor Detail

AbstractResourceCachingStrategy

public AbstractResourceCachingStrategy()
Method Detail

isLastModifiedCacheEnabled

public boolean isLastModifiedCacheEnabled()
returns if caching if lastModified timestamp lookup is enabled

Returns:
true if enabled

setLastModifiedCacheEnabled

public void setLastModifiedCacheEnabled(boolean enabled)
controls request-scoped caching of lookups to last modified time of the resource reference

Parameters:
enabled -

getLastModified

protected Time getLastModified(ResourceReference resourceReference)
That method gets the last modification timestamp from the specified resource reference.

The timestamp is cached in the meta data of the current request cycle to eliminate repeated lookups of the same resource reference which will harm performance.

Parameters:
resourceReference - resource reference
Returns:
last modification timestamp or null if no timestamp provided


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.