public class CachingResourceVersion extends Object implements IResourceVersion
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.Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
String |
getVersion(IStaticCacheableResource resource)
get unique string identifying the version of the resource
|
Pattern |
getVersionPattern()
a pattern that matches returned versions
|
void |
invalidate(IStaticCacheableResource resource)
remove cacheable resource from cache
|
void |
invalidateAll() |
public CachingResourceVersion(IResourceVersion delegate)
delegate
- delegating resource version providerpublic CachingResourceVersion(IResourceVersion delegate, int maxEntries)
maxEntries
before evicting the oldest entries.delegate
- resource version providermaxEntries
- maximum number of cache entriespublic String getVersion(IStaticCacheableResource resource)
IResourceVersion
getVersion
in interface IResourceVersion
resource
- cacheable resourcenull
if version string could not be calculatedpublic Pattern getVersionPattern()
IResourceVersion
getVersionPattern
in interface IResourceVersion
null
if no pattern
is availablepublic void invalidate(IStaticCacheableResource resource)
resource
- cacheable resourcepublic void invalidateAll()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.