Configuration c = getConfiguration(cacheName);
setConfigurationName(cacheName, c);
c.setGlobalConfiguration(globalConfiguration);
c.assertValid();
Cache cache = new InternalCacheFactory().createCache(c, globalComponentRegistry, cacheName, reflectionCache);
CacheWrapper cw = new CacheWrapper(cache);
try {
existingCache = caches.putIfAbsent(cacheName, cw);
if (existingCache != null) {
throw new IllegalStateException("attempt to initialize the cache twice");