private Cache createCache(String cacheName) {
CacheWrapper existingCache = caches.get(cacheName);
if (existingCache != null)
return existingCache.getCache();
Configuration c = getConfiguration(cacheName);
setConfigurationName(cacheName, c);
c.setGlobalConfiguration(globalConfiguration);
c.accept(configurationValidator);
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) {