Class ConfluenceMonitoringCache<K,V>

java.lang.Object
com.atlassian.confluence.cache.ConfluenceMonitoringCache<K,V>
All Implemented Interfaces:
com.atlassian.cache.Cache<K,V>, com.atlassian.cache.ManagedCache, com.atlassian.cache.ReadThroughCache<K,V>, ConfluenceCache<K,V>

@Internal public class ConfluenceMonitoringCache<K,V> extends Object implements ConfluenceCache<K,V>
A wrapper for monitoring the performance of Confluence caches. The performance is monitored using the supplied ConfluenceMonitoring instance.
Since:
5.6
  • Constructor Details

    • ConfluenceMonitoringCache

      public ConfluenceMonitoringCache(ConfluenceCache<K,V> cache, ConfluenceMonitoring confluenceMonitoring)
      Constructs a new instance.
      Parameters:
      cache - the (Cache) interface to the cache to be monitored
      confluenceMonitoring - the ConfluenceMonitoring instance to use for monitoring
  • Method Details

    • get

      public V get(@NonNull K key)
      Specified by:
      get in interface com.atlassian.cache.ReadThroughCache<K,V>
    • get

      public @NonNull V get(@NonNull K k, @NonNull com.atlassian.cache.Supplier<? extends V> supplier)
      Specified by:
      get in interface com.atlassian.cache.ReadThroughCache<K,V>
    • containsKey

      public boolean containsKey(@NonNull K k)
      Specified by:
      containsKey in interface com.atlassian.cache.ReadThroughCache<K,V>
    • getKeys

      public @NonNull Collection<K> getKeys()
      Specified by:
      getKeys in interface com.atlassian.cache.ReadThroughCache<K,V>
    • put

      public void put(@NonNull K key, @NonNull V value)
      Specified by:
      put in interface com.atlassian.cache.Cache<K,V>
    • remove

      public void remove(@NonNull K key)
      Specified by:
      remove in interface com.atlassian.cache.ReadThroughCache<K,V>
    • removeAll

      public void removeAll()
      Specified by:
      removeAll in interface com.atlassian.cache.ReadThroughCache<K,V>
    • putIfAbsent

      public V putIfAbsent(@NonNull K key, @NonNull V value)
      Specified by:
      putIfAbsent in interface com.atlassian.cache.Cache<K,V>
    • replace

      public boolean replace(@NonNull K key, @NonNull V oldValue, @NonNull V newValue)
      Specified by:
      replace in interface com.atlassian.cache.Cache<K,V>
    • addListener

      public void addListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener, boolean b)
      Specified by:
      addListener in interface com.atlassian.cache.Cache<K,V>
    • removeListener

      public void removeListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> kvCacheEntryListener)
      Specified by:
      removeListener in interface com.atlassian.cache.Cache<K,V>
    • remove

      public boolean remove(@NonNull K key, @NonNull V value)
      Specified by:
      remove in interface com.atlassian.cache.ReadThroughCache<K,V>
    • clear

      public void clear()
      Specified by:
      clear in interface com.atlassian.cache.ManagedCache
    • getName

      public @NonNull String getName()
      Specified by:
      getName in interface com.atlassian.cache.ManagedCache
      Specified by:
      getName in interface com.atlassian.cache.ReadThroughCache<K,V>
    • isFlushable

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

      public @Nullable Integer currentMaxEntries()
      Specified by:
      currentMaxEntries in interface com.atlassian.cache.ManagedCache
    • updateMaxEntries

      public boolean updateMaxEntries(int newValue)
      Specified by:
      updateMaxEntries in interface com.atlassian.cache.ManagedCache
    • currentExpireAfterAccessMillis

      public @Nullable Long currentExpireAfterAccessMillis()
      Specified by:
      currentExpireAfterAccessMillis in interface com.atlassian.cache.ManagedCache
    • updateExpireAfterAccess

      public boolean updateExpireAfterAccess(long expireAfter, @NonNull TimeUnit timeUnit)
      Specified by:
      updateExpireAfterAccess in interface com.atlassian.cache.ManagedCache
    • currentExpireAfterWriteMillis

      public @Nullable Long currentExpireAfterWriteMillis()
      Specified by:
      currentExpireAfterWriteMillis in interface com.atlassian.cache.ManagedCache
    • updateExpireAfterWrite

      public boolean updateExpireAfterWrite(long expireAfter, @NonNull TimeUnit timeUnit)
      Specified by:
      updateExpireAfterWrite in interface com.atlassian.cache.ManagedCache
    • isLocal

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

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

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

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

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

      public @NonNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>> getStatistics()
      Specified by:
      getStatistics in interface com.atlassian.cache.ManagedCache
    • getCacheCollector

      public @Nullable com.atlassian.instrumentation.caches.CacheCollector getCacheCollector()
      Specified by:
      getCacheCollector in interface com.atlassian.cache.ManagedCache
    • createSplit

      protected Split createSplit(String operation)
    • createReadSplit

      protected Split createReadSplit()
    • createWriteSplit

      protected Split createWriteSplit()
    • createLockSplit

      protected Split createLockSplit()
    • createUnlockSplit

      protected Split createUnlockSplit()