org.apache.wicket.request.resource.caching.version
Class CachingResourceVersion

java.lang.Object
  extended by org.apache.wicket.request.resource.caching.version.CachingResourceVersion
All Implemented Interfaces:
IResourceVersion

public class CachingResourceVersion
extends java.lang.Object
implements IResourceVersion

Caches the results of a delegating IResourceVersion instance in a member variable. The cache will be valid for the lifetime of this instance. It will expire the oldest entries if the maximum number of entries is exceeded.

Since:
1.5

Constructor Summary
CachingResourceVersion(IResourceVersion delegate)
          create version cache

the cache will accept up to before evicting the oldest entries.

CachingResourceVersion(IResourceVersion delegate, int maxEntries)
          create version cache

the cache will accept a maximum number of entries specified by maxEntries before evicting the oldest entries.

 
Method Summary
 java.lang.String getVersion(IStaticCacheableResource resource)
          get unique string identifying the version of the resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingResourceVersion

public CachingResourceVersion(IResourceVersion delegate)
create version cache

the cache will accept up to before evicting the oldest entries.

Parameters:
delegate - delegating resource version provider

CachingResourceVersion

public CachingResourceVersion(IResourceVersion delegate,
                              int maxEntries)
create version cache

the cache will accept a maximum number of entries specified by maxEntries before evicting the oldest entries.

Parameters:
delegate - resource version provider
maxEntries - maximum number of cache entries
Method Detail

getVersion

public java.lang.String getVersion(IStaticCacheableResource resource)
Description copied from interface: IResourceVersion
get unique string identifying the version of the resource

Specified by:
getVersion in interface IResourceVersion
Parameters:
resource - cacheable resource
Returns:
unique version string or null if version string could not be calculated


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