Package com.atlassian.confluence.cache
Class ManagedCacheTemplate
java.lang.Object
com.atlassian.confluence.cache.ManagedCacheTemplate
- All Implemented Interfaces:
com.atlassian.cache.ManagedCache
public abstract class ManagedCacheTemplate
extends Object
implements com.atlassian.cache.ManagedCache
A partial implementation of
ManagedCache, must be subclassed to fully implement.
Note that the methods implemented here are based upon the supplied CacheSettings, which means they reflect
the requested settings of the given cache, which may differ from the _actual_ settings reflected by the acual cache.
For example, the CacheSettings may specify isLocal=false (i.e. a remote cache), but the backing cache implementation
may only support local caches, but isLocal() will return false because that's what the CacheSettings requested.
If this behaviour is undesirable, override the appropriate methods to give a better reflection of the actual cache settings.
- Since:
- 10.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionManagedCacheTemplate(String name, com.atlassian.cache.CacheSettings settings) -
Method Summary
Modifier and TypeMethodDescriptiongetName()final booleanfinal booleanisLocal()final booleanfinal booleanbooleanvoidsetStatistics(boolean enabled) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.cache.ManagedCache
clear, currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getCacheCollector, getStatistics, updateExpireAfterAccess, updateExpireAfterWrite, updateMaxEntries
-
Field Details
-
name
-
settings
protected final com.atlassian.cache.CacheSettings settings
-
-
Constructor Details
-
ManagedCacheTemplate
-
-
Method Details
-
isFlushable
public final boolean isFlushable()- Specified by:
isFlushablein interfacecom.atlassian.cache.ManagedCache
-
isLocal
public final boolean isLocal()- Specified by:
isLocalin interfacecom.atlassian.cache.ManagedCache
-
isReplicateAsynchronously
public final boolean isReplicateAsynchronously()- Specified by:
isReplicateAsynchronouslyin interfacecom.atlassian.cache.ManagedCache
-
isReplicateViaCopy
public final boolean isReplicateViaCopy()- Specified by:
isReplicateViaCopyin interfacecom.atlassian.cache.ManagedCache
-
getName
- Specified by:
getNamein interfacecom.atlassian.cache.ManagedCache
-
isStatisticsEnabled
public boolean isStatisticsEnabled()- Specified by:
isStatisticsEnabledin interfacecom.atlassian.cache.ManagedCache
-
setStatistics
public void setStatistics(boolean enabled) - Specified by:
setStatisticsin interfacecom.atlassian.cache.ManagedCache
-