Class SpringCache2kCacheManager

  • All Implemented Interfaces:
    org.springframework.beans.factory.DisposableBean, org.springframework.cache.CacheManager

    public class SpringCache2kCacheManager
    extends Object
    implements org.springframework.cache.CacheManager, org.springframework.beans.factory.DisposableBean
    A Spring cache manager that manages cache2k caches. The manager delegates to the cache2k native CacheManager. The available caches can be configured programmatically in a Spring configuration class via the use of addCaches(Function[]) or via the cache2k XML configuration.
    Author:
    Jens Wilke
    See Also:
    Spring Framework - cache2k User Guide
    • Field Detail

      • DEFAULT_SPRING_CACHE_MANAGER_NAME

        public static final String DEFAULT_SPRING_CACHE_MANAGER_NAME
        Default name used for the cache2k cache manager controlled by the spring cache manager.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SpringCache2kCacheManager

        public SpringCache2kCacheManager()
        Construct a spring cache manager, using the cache2k cache manager with the name "springDefault". It is recommended that the spring cache manager uses a cache2k cache manager exclusively and all caches are created only via the spring cache manager. (Behavior since cache2k version 1.4)
        See Also:
        CacheManager
      • SpringCache2kCacheManager

        public SpringCache2kCacheManager​(String name)
        Construct a spring cache manager, using the cache2k cache manager instance with the specified name.
        See Also:
        CacheManager, CacheManager.getInstance()
      • SpringCache2kCacheManager

        public SpringCache2kCacheManager​(org.cache2k.CacheManager manager)
        Construct a spring cache manager, using a custom cache2k cache manager. This allows for the use of a different manager name and classloader.
        See Also:
        CacheManager, CacheManager.getInstance(String), CacheManager.getInstance(ClassLoader), CacheManager.getInstance(ClassLoader, String)