Class CacheFactoryEhcache

java.lang.Object
com.atlassian.crowd.manager.cache.CacheFactoryEhcache
All Implemented Interfaces:
com.atlassian.cache.CacheFactory, com.atlassian.cache.CacheManager

public class CacheFactoryEhcache extends Object implements com.atlassian.cache.CacheFactory, com.atlassian.cache.CacheManager
A CacheFactory (and also a CacheManager) backed by Ehcache. This is implemented separately from atlassian-cache-ehcache to restrict the scope to how Crowd currently uses Ehcache, and intentionally omit API that may not be supported by a future simpler version of Cache.
  • Constructor Details

    • CacheFactoryEhcache

      public CacheFactoryEhcache(net.sf.ehcache.CacheManager cacheManager)
  • Method Details

    • getCache

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

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

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

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

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

      @Nonnull public <V> com.atlassian.cache.CachedReference<V> getCachedReference(@Nonnull Class<?> owningClass, @Nonnull String name, @Nonnull 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(@Nonnull Class<?> owningClass, @Nonnull String name, @Nonnull com.atlassian.cache.Supplier<V> supplier, @Nonnull com.atlassian.cache.CacheSettings required)
      Specified by:
      getCachedReference in interface com.atlassian.cache.CacheFactory
    • getCachedReference

      @Nonnull public <V> com.atlassian.cache.CachedReference<V> getCachedReference(@Nonnull String name, @Nonnull 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(@Nonnull String name, @Nonnull com.atlassian.cache.Supplier<V> supplier, @Nonnull com.atlassian.cache.CacheSettings required)
      Specified by:
      getCachedReference in interface com.atlassian.cache.CacheFactory
    • flushCaches

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

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

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

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

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