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.
    • Constructor Summary

      Constructors 
      Constructor Description
      EhCacheManager​(com.atlassian.cache.CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider)  
      EhCacheManager​(ConfluenceMonitoring confluenceMonitoring, com.atlassian.cache.CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider, CacheOperationsWhitelistService cacheOperationsWhitelistService)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 8.3
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void flushCaches()  
      <K,​V>
      @NonNull com.atlassian.cache.Cache<K,​V>
      getCache​(@NonNull Class<?> owningClass, @NonNull String name)  
      <K,​V>
      @NonNull com.atlassian.confluence.cache.ehcache.ConfluenceEhCache<K,​V>
      getCache​(@NonNull String name)  
      <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
      <K,​V>
      @NonNull com.atlassian.cache.Cache<K,​V>
      getCache​(@NonNull String name, com.atlassian.cache.CacheLoader<K,​V> loader)  
      <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)  
      <V> @NonNull com.atlassian.cache.CachedReference<V> getCachedReference​(@NonNull Class<?> owningClass, @NonNull String fieldName, @NonNull com.atlassian.cache.Supplier<V> supplier)  
      <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)  
      <V> @NonNull com.atlassian.cache.CachedReference<V> getCachedReference​(@NonNull String name, @NonNull com.atlassian.cache.Supplier<V> supplier)  
      <V> @NonNull com.atlassian.cache.CachedReference<V> getCachedReference​(@NonNull String name, @NonNull com.atlassian.cache.Supplier<V> supplier, @NonNull com.atlassian.cache.CacheSettings settings)  
      @NonNull Collection<com.atlassian.cache.Cache<?,​?>> getCaches()
      Deprecated.
      since 7.2.
      net.sf.ehcache.CacheManager getEhCacheManager()  
      com.atlassian.cache.ManagedCache getManagedCache​(@NonNull String name)  
      @NonNull Collection<com.atlassian.cache.ManagedCache> getManagedCaches()  
      void shutdown()  
      void shutdownCacheManager()  
    • Constructor Detail

      • EhCacheManager

        public EhCacheManager​(com.atlassian.cache.CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider)
        Since:
        8.3
      • EhCacheManager

        @Deprecated(forRemoval=true)
        public EhCacheManager​(ConfluenceMonitoring confluenceMonitoring,
                              com.atlassian.cache.CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider,
                              CacheOperationsWhitelistService cacheOperationsWhitelistService)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.3
        Since:
        7.5
    • 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()