Class EhCacheManager

  • All Implemented Interfaces:
    com.atlassian.cache.CacheFactory, com.atlassian.cache.CacheManager

    public class EhCacheManager
    extends Object
    implements com.atlassian.cache.CacheManager
    Confluence-specific implementation of CacheManager which delegates to an atlassian-cache EhCacheManager, decorating it with Confluence-specific functionality.
    • Method Detail

      • shutdownCacheManager

        @PreDestroy
        public void shutdownCacheManager()
      • flushCaches

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

        @Deprecated
        public @NonNull Collection<com.atlassian.cache.Cache<?,​?>> getCaches()
        Deprecated.
        since 7.2. Use getManagedCaches() instead.
        Specified by:
        getCaches in interface com.atlassian.cache.CacheManager
      • getCache

        public <K,​V> @NonNull com.atlassian.confluence.cache.ehcache.ConfluenceEhCache<K,​V> getCache​(@NonNull String name)
        Specified by:
        getCache in interface com.atlassian.cache.CacheFactory
      • getCache

        @Deprecated
        public <K,​V> @NonNull com.atlassian.cache.Cache<K,​V> getCache​(@NonNull String name,
                                                                                  @NonNull Class<K> keyType,
                                                                                  @NonNull Class<V> valueType)
        Deprecated.
        since 5.7, since it's deprecated in atlassian-cache library 2.5.0
        Specified by:
        getCache in interface com.atlassian.cache.CacheFactory
      • getManagedCaches

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

        public com.atlassian.cache.ManagedCache getManagedCache​(@NonNull 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

        public <V> @NonNull 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

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

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

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

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

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

        public <K,​V> @NonNull com.atlassian.confluence.cache.ehcache.ConfluenceEhCache<K,​V> getCache​(@NonNull String name,
                                                                                                                 com.atlassian.cache.CacheLoader<K,​V> loader,
                                                                                                                 @NonNull com.atlassian.cache.CacheSettings settings)
        Specified by:
        getCache in interface com.atlassian.cache.CacheFactory
      • getEhCacheManager

        public net.sf.ehcache.CacheManager getEhCacheManager()