public CacheManager getCacheManager()

in src/main/java/org/apache/geronimo/jcache/simple/SimpleProvider.java [38:61]


    public CacheManager getCacheManager(final URI inUri, final ClassLoader inClassLoader, final Properties properties) {
        final URI uri = inUri != null ? inUri : getDefaultURI();
        final ClassLoader classLoader = inClassLoader != null ? inClassLoader : getDefaultClassLoader();

        ConcurrentMap<URI, CacheManager> managers = cacheManagersByLoader.get(classLoader);
        if (managers == null) {
            managers = new ConcurrentHashMap<>();
            final ConcurrentMap<URI, CacheManager> existingManagers = cacheManagersByLoader.putIfAbsent(classLoader, managers);
            if (existingManagers != null) {
                managers = existingManagers;
            }
        }

        CacheManager mgr = managers.get(uri);
        if (mgr == null) {
            mgr = new SimpleManager(this, uri, classLoader, properties);
            final CacheManager existing = managers.putIfAbsent(uri, mgr);
            if (existing != null) {
                mgr = existing;
            }
        }

        return mgr;
    }