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 Details

    • name

      protected final String name
    • settings

      protected final com.atlassian.cache.CacheSettings settings
  • Constructor Details

    • ManagedCacheTemplate

      public ManagedCacheTemplate(String name, com.atlassian.cache.CacheSettings settings)
  • Method Details

    • isFlushable

      public final boolean isFlushable()
      Specified by:
      isFlushable in interface com.atlassian.cache.ManagedCache
    • isLocal

      public final boolean isLocal()
      Specified by:
      isLocal in interface com.atlassian.cache.ManagedCache
    • isReplicateAsynchronously

      public final boolean isReplicateAsynchronously()
      Specified by:
      isReplicateAsynchronously in interface com.atlassian.cache.ManagedCache
    • isReplicateViaCopy

      public final boolean isReplicateViaCopy()
      Specified by:
      isReplicateViaCopy in interface com.atlassian.cache.ManagedCache
    • getName

      public String getName()
      Specified by:
      getName in interface com.atlassian.cache.ManagedCache
    • isStatisticsEnabled

      public boolean isStatisticsEnabled()
      Specified by:
      isStatisticsEnabled in interface com.atlassian.cache.ManagedCache
    • setStatistics

      public void setStatistics(boolean enabled)
      Specified by:
      setStatistics in interface com.atlassian.cache.ManagedCache