Class SloMoCacheManager

java.lang.Object
com.atlassian.jira.cache.slomo.SloMoCacheManager
All Implemented Interfaces:
com.atlassian.cache.CacheFactory, com.atlassian.cache.CacheManager

@ParametersAreNonnullByDefault public class SloMoCacheManager extends Object implements com.atlassian.cache.CacheManager
A rather obnoxious implementation of CacheManager that makes every remote cache slower.

This is intended for simulating what happens when caches live externally to the JVM and is only intended for development and testing purposes. As tempting as it might be, you must resist the urge to enable this on a production system. Your end users would be somewhat less than thrilled with that experience.

Since:
v7.1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    SloMoCacheManager(com.atlassian.cache.CacheManager delegate, int delay)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    <K, V> com.atlassian.cache.Cache<K,V>
    getCache(Class<?> owningClass, String name)
     
    <K, V> com.atlassian.cache.Cache<K,V>
     
    <K, V> com.atlassian.cache.Cache<K,V>
    getCache(String name, com.atlassian.cache.CacheLoader<K,V> cacheLoader)
     
    <K, V> com.atlassian.cache.Cache<K,V>
    getCache(String name, com.atlassian.cache.CacheLoader<K,V> cacheLoader, com.atlassian.cache.CacheSettings cacheSettings)
     
    <K, V> com.atlassian.cache.Cache<K,V>
    getCache(String name, Class<K> keyClass, Class<V> valueClass)
    Deprecated.
    <V> com.atlassian.cache.CachedReference<V>
    getCachedReference(Class<?> owningClass, String name, com.atlassian.cache.Supplier<V> supplier)
     
    <V> com.atlassian.cache.CachedReference<V>
    getCachedReference(Class<?> owningClass, String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings cacheSettings)
     
    <V> com.atlassian.cache.CachedReference<V>
    getCachedReference(String name, com.atlassian.cache.Supplier<V> supplier)
     
    <V> com.atlassian.cache.CachedReference<V>
    getCachedReference(String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings cacheSettings)
     
    Collection<com.atlassian.cache.Cache<?,?>>
    Deprecated.
    com.atlassian.cache.ManagedCache
     
    Collection<com.atlassian.cache.ManagedCache>
     
    void
     

    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.CacheFactory

    getReadThroughCache, getReadThroughCache
  • Constructor Details

    • SloMoCacheManager

      public SloMoCacheManager(com.atlassian.cache.CacheManager delegate, int delay)
  • Method Details

    • getCaches

      @Deprecated @Nonnull public Collection<com.atlassian.cache.Cache<?,?>> getCaches()
      Deprecated.
      Specified by:
      getCaches in interface com.atlassian.cache.CacheManager
    • getManagedCaches

      @Nonnull public Collection<com.atlassian.cache.ManagedCache> getManagedCaches()
      Specified by:
      getManagedCaches in interface com.atlassian.cache.CacheManager
    • flushCaches

      public void flushCaches()
      Specified by:
      flushCaches in interface com.atlassian.cache.CacheManager
    • getManagedCache

      @Nullable public com.atlassian.cache.ManagedCache getManagedCache(String name)
      Specified by:
      getManagedCache in interface com.atlassian.cache.CacheManager
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface com.atlassian.cache.CacheManager
    • getCachedReference

      @Nonnull public <V> com.atlassian.cache.CachedReference<V> getCachedReference(String name, com.atlassian.cache.Supplier<V> supplier)
      Specified by:
      getCachedReference in interface com.atlassian.cache.CacheFactory
    • getCachedReference

      @Nonnull public <V> com.atlassian.cache.CachedReference<V> getCachedReference(String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings cacheSettings)
      Specified by:
      getCachedReference in interface com.atlassian.cache.CacheFactory
    • getCachedReference

      @Nonnull public <V> com.atlassian.cache.CachedReference<V> getCachedReference(Class<?> owningClass, String name, com.atlassian.cache.Supplier<V> supplier)
      Specified by:
      getCachedReference in interface com.atlassian.cache.CacheFactory
    • getCachedReference

      @Nonnull public <V> com.atlassian.cache.CachedReference<V> getCachedReference(Class<?> owningClass, String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings cacheSettings)
      Specified by:
      getCachedReference in interface com.atlassian.cache.CacheFactory
    • getCache

      @Nonnull public <K, V> com.atlassian.cache.Cache<K,V> getCache(String name)
      Specified by:
      getCache in interface com.atlassian.cache.CacheFactory
    • getCache

      @Nonnull public <K, V> com.atlassian.cache.Cache<K,V> getCache(Class<?> owningClass, String name)
      Specified by:
      getCache in interface com.atlassian.cache.CacheFactory
    • getCache

      @Nonnull public <K, V> com.atlassian.cache.Cache<K,V> getCache(String name, @Nullable com.atlassian.cache.CacheLoader<K,V> cacheLoader)
      Specified by:
      getCache in interface com.atlassian.cache.CacheFactory
    • getCache

      @Nonnull public <K, V> com.atlassian.cache.Cache<K,V> getCache(String name, @Nullable com.atlassian.cache.CacheLoader<K,V> cacheLoader, com.atlassian.cache.CacheSettings cacheSettings)
      Specified by:
      getCache in interface com.atlassian.cache.CacheFactory
    • getCache

      @Deprecated @Nonnull public <K, V> com.atlassian.cache.Cache<K,V> getCache(String name, Class<K> keyClass, Class<V> valueClass)
      Deprecated.
      Specified by:
      getCache in interface com.atlassian.cache.CacheFactory