Module org.apache.wicket.core
Class CachingResourceVersion
java.lang.Object
org.apache.wicket.request.resource.caching.version.CachingResourceVersion
- All Implemented Interfaces:
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
- Author:
- Peter Ertl
-
Constructor Summary
ConstructorDescriptionCachingResourceVersion
(IResourceVersion delegate) create version cacheCachingResourceVersion
(IResourceVersion delegate, int maxEntries) create version cache -
Method Summary
Modifier and TypeMethodDescriptiongetVersion
(IStaticCacheableResource resource) get unique string identifying the version of the resourcea pattern that matches returned versionsvoid
invalidate
(IStaticCacheableResource resource) remove cacheable resource from cachevoid
-
Constructor Details
-
CachingResourceVersion
create version cache the cache will accept up to 5000 before evicting the oldest entries.- Parameters:
delegate
- delegating resource version provider
-
CachingResourceVersion
create version cache the cache will accept a maximum number of entries specified bymaxEntries
before evicting the oldest entries.- Parameters:
delegate
- resource version providermaxEntries
- maximum number of cache entries
-
-
Method Details
-
getVersion
Description copied from interface:IResourceVersion
get unique string identifying the version of the resource- Specified by:
getVersion
in interfaceIResourceVersion
- Parameters:
resource
- cacheable resource- Returns:
- unique version string or
null
if version string could not be calculated
-
getVersionPattern
Description copied from interface:IResourceVersion
a pattern that matches returned versions- Specified by:
getVersionPattern
in interfaceIResourceVersion
- Returns:
- a pattern or
null
if no pattern is available
-
invalidate
remove cacheable resource from cache- Parameters:
resource
- cacheable resource
-
invalidateAll
-