private EmbeddedCacheManager createCustomCacheManager(String cfgName, Properties properties) {
try {
InfinispanConfiguration configuration = InfinispanConfiguration.newInfinispanConfiguration(
cfgName, InfinispanConfiguration.resolveSchemaPath(),
new ConfigurationValidatingVisitor());
GlobalConfiguration globalConfiguration = configuration.parseGlobalConfiguration();
Configuration defaultConfiguration = configuration.parseDefaultConfiguration();
TransactionManagerLookupDelegator transactionManagerLookupDelegator = new TransactionManagerLookupDelegator( properties );
final DefaultCacheManager cacheManager = new DefaultCacheManager( globalConfiguration, defaultConfiguration, true );
for (Map.Entry<String, Configuration> entry : configuration.parseNamedConfigurations().entrySet()) {
Configuration cfg = entry.getValue();