public Cache<Object, Object> getCache(String configName, boolean create) throws Exception { Cache<Object, Object> cache; synchronized (caches) { cache = caches.get(configName); if (cache == null && create) { Configuration config = configRegistry.getConfiguration(configName); if (channelFactory != null && config.getMultiplexerStack() != null) { config.getRuntimeConfig().setMuxChannelFactory(channelFactory); } cache = createCache(config); registerCache(cache, configName); } else if (cache != null) { incrementCheckout(configName); } } return cache; }