Class CacheManagerImpl

  • All Implemented Interfaces:
    AutoCloseable

    public class CacheManagerImpl
    extends org.cache2k.CacheManager
    Author:
    Jens Wilke
    • Field Detail

      • PROVIDER

        public static final org.cache2k.spi.Cache2kCoreProvider PROVIDER
    • Method Detail

      • checkName

        public static void checkName​(String s)
        Don't accept a cache or manager names with too weird characters.
        See Also:
        Cache2kBuilder.name(String)
      • cacheClosed

        public void cacheClosed​(org.cache2k.Cache<?,​?> c)
        Called from the cache during close()
      • isDefaultManager

        public boolean isDefaultManager()
        Specified by:
        isDefaultManager in class org.cache2k.CacheManager
      • getName

        public String getName()
        Specified by:
        getName in class org.cache2k.CacheManager
      • getActiveCaches

        public Iterable<org.cache2k.Cache> getActiveCaches()
        Specified by:
        getActiveCaches in class org.cache2k.CacheManager
      • getConfiguredCacheNames

        public Iterable<String> getConfiguredCacheNames()
        Specified by:
        getConfiguredCacheNames in class org.cache2k.CacheManager
      • getCache

        public <K,​V> org.cache2k.Cache<K,​V> getCache​(String name)
        Specified by:
        getCache in class org.cache2k.CacheManager
      • createCache

        public <K,​V> org.cache2k.Cache<K,​V> createCache​(org.cache2k.config.Cache2kConfig<K,​V> cfg)
        Specified by:
        createCache in class org.cache2k.CacheManager
      • clear

        public void clear()
        Specified by:
        clear in class org.cache2k.CacheManager
      • close

        public void close()
        The shutdown takes place in two phases. First all caches are notified to cancel their scheduled timer jobs, after that the shutdown is done. Cancelling the timer jobs first is needed, because there may be cache stacking and a timer job of one cache may call an already closed cache.

        Rationale exception handling: Exceptions on shutdown just could silently ignored, because a shutdown is done any way. Exceptions could be happened long before in a parallel task, shutdown is the last point where this could be propagated to the application. Silently ignoring is bad anyway, because this will cause that serious problems keep undetected. The exception and error handling within the cache tries everything that exceptions will be routed through as early and directly as possible.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in class org.cache2k.CacheManager
      • getProperties

        public Properties getProperties()
        Specified by:
        getProperties in class org.cache2k.CacheManager
      • getClassLoader

        public ClassLoader getClassLoader()
        Specified by:
        getClassLoader in class org.cache2k.CacheManager
      • getVersion

        public String getVersion()
      • isClosed

        public boolean isClosed()
        Specified by:
        isClosed in class org.cache2k.CacheManager
      • getLockObject

        public Object getLockObject()
        Used for JSR107 cache manager implementation