|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.magnolia.module.cache.cachepolicy.Default
public class Default
A basic CachePolicy driven by voters. This policy implementation uses
DefaultCacheKey to identify each cache entry.
| Field Summary | |
|---|---|
static java.lang.String |
UUID_KEY_MAP_KEY
|
| Constructor Summary | |
|---|---|
Default()
|
|
| Method Summary | |
|---|---|
VoterSet |
getVoters()
|
void |
persistCacheKey(java.lang.String repo,
java.lang.String uuid,
java.lang.Object key)
Presists mapping between uuid and cache key in case the given cache policy implementation cares about such details. |
java.lang.Object[] |
removeCacheKeys(java.lang.String uuid,
java.lang.String repository)
Returns cache keys for the given item or null if such keys can't be obtained or policy doesn't want to share it. |
java.lang.Object |
retrieveCacheKey(AggregationState aggregationState)
Returns cache key for the given item or null if such key can't be obtained or policy doesn't want to share it. |
java.lang.Object[] |
retrieveCacheKeys(java.lang.String uuid,
java.lang.String repository)
Returns cache keys for the given item or null if such keys can't be obtained or policy doesn't want to share it. |
void |
setVoters(VoterSet voters)
|
protected boolean |
shouldBypass(AggregationState aggregationState,
java.lang.Object key)
|
CachePolicyResult |
shouldCache(Cache cache,
AggregationState aggregationState,
FlushPolicy flushPolicy)
Implementations can chose whether to cache or not - but note that the aggregationState might not be completely populated. |
protected boolean |
shouldRefresh(AggregationState aggregationState,
java.lang.Object key)
Checks whether requested content should be served from cache or refreshed instead. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String UUID_KEY_MAP_KEY
| Constructor Detail |
|---|
public Default()
| Method Detail |
|---|
public CachePolicyResult shouldCache(Cache cache,
AggregationState aggregationState,
FlushPolicy flushPolicy)
CachePolicy
shouldCache in interface CachePolicy
protected boolean shouldRefresh(AggregationState aggregationState,
java.lang.Object key)
protected boolean shouldBypass(AggregationState aggregationState,
java.lang.Object key)
public java.lang.Object retrieveCacheKey(AggregationState aggregationState)
CachePolicy
retrieveCacheKey in interface CachePolicy
public java.lang.Object[] retrieveCacheKeys(java.lang.String uuid,
java.lang.String repository)
CachePolicy
retrieveCacheKeys in interface CachePolicy
public void persistCacheKey(java.lang.String repo,
java.lang.String uuid,
java.lang.Object key)
CachePolicy
persistCacheKey in interface CachePolicypublic VoterSet getVoters()
public void setVoters(VoterSet voters)
public java.lang.Object[] removeCacheKeys(java.lang.String uuid,
java.lang.String repository)
CachePolicy
removeCacheKeys in interface CachePolicy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||