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 boolean
final boolean
isLocal()
final boolean
final boolean
boolean
void
setStatistics
(boolean enabled) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
isFlushable
in interfacecom.atlassian.cache.ManagedCache
-
isLocal
public final boolean isLocal()- Specified by:
isLocal
in interfacecom.atlassian.cache.ManagedCache
-
isReplicateAsynchronously
public final boolean isReplicateAsynchronously()- Specified by:
isReplicateAsynchronously
in interfacecom.atlassian.cache.ManagedCache
-
isReplicateViaCopy
public final boolean isReplicateViaCopy()- Specified by:
isReplicateViaCopy
in interfacecom.atlassian.cache.ManagedCache
-
getName
- Specified by:
getName
in interfacecom.atlassian.cache.ManagedCache
-
isStatisticsEnabled
public boolean isStatisticsEnabled()- Specified by:
isStatisticsEnabled
in interfacecom.atlassian.cache.ManagedCache
-
setStatistics
public void setStatistics(boolean enabled) - Specified by:
setStatistics
in interfacecom.atlassian.cache.ManagedCache
-