@Override
    public <K, V> Cache<K, V> getCache(String name) throws CacheException {

        javax.cache.Cache<K, V> cache = ensureCacheManager().getCache(name);

        if (cache == null) {
            synchronized (this) {
                cache = ensureCacheManager().getCache(name);
                if (cache == null) {
                    LOGGER.debug("Cache with name '{}' does not yet exist.  Creating now.", name);
                    cache = ensureCacheManager().createCache(name, new MutableConfiguration<>());
                    LOGGER.debug("Added JCache named [{}]", name);
                } else {
                    LOGGER.debug("Using existing JCache named [{}]", cache.getName());
                }
            }
        }

        return new JCache<>(cache);
    }
Indicates if the CacheManager instance was implicitly/automatically created by this instance, indicating that
it should be automatically cleaned up as well on shutdown.
support/jcache/src/main/java/org/apache/shiro/cache/jcache/JCacheManager.java