类 CaffeineCacheManager

    • 构造器详细资料

      • CaffeineCacheManager

        public CaffeineCacheManager()
        Construct a dynamic CaffeineCacheManager, lazily creating cache instances as they are being requested.
      • CaffeineCacheManager

        public CaffeineCacheManager​(String... cacheNames)
        Construct a static CaffeineCacheManager, managing caches for the specified cache names only.
    • 方法详细资料

      • setCacheNames

        public void setCacheNames​(Collection<String> cacheNames)
        Specify the set of cache names for this CacheManager's 'static' mode.

        The number of caches and their names will be fixed after a call to this method, with no creation of further cache regions at runtime.

        Calling this with a null collection argument resets the mode to 'dynamic', allowing for further creation of caches again.

      • setAllowNullValues

        public void setAllowNullValues​(boolean allowNullValues)
        Specify whether to accept and convert null values for all caches in this cache manager.

        Default is "true", despite Caffeine itself not supporting null values. An internal holder object will be used to store user-level nulls.

      • isAllowNullValues

        public boolean isAllowNullValues()
        Return whether this cache manager accepts and converts null values for all of its caches.
      • getCache

        public Cache getCache​(String name)
        从接口复制的说明: CacheManager
        Get the cache associated with the given name.

        Note that the cache may be lazily created at runtime if the native provider supports it.

        指定者:
        getCache 在接口中 CacheManager
        参数:
        name - the cache identifier (must not be null)
        返回:
        the associated cache, or null if such a cache does not exist or could be not created
      • createCaffeineCache

        protected Cache createCaffeineCache​(String name)
        Create a new CaffeineCache instance for the specified cache name.
        参数:
        name - the name of the cache
        返回:
        the Spring CaffeineCache adapter (or a decorator thereof)
      • createNativeCaffeineCache

        protected com.github.benmanes.caffeine.cache.Cache<Object,​ObjectcreateNativeCaffeineCache​(String name)
        Create a native Caffeine Cache instance for the specified cache name.
        参数:
        name - the name of the cache
        返回:
        the native Caffeine Cache instance