config.setRehashRpcTimeout(rehashing.get(ModelKeys.TIMEOUT).asLong());
}
}
if (cache.hasDefined(ModelKeys.STORE)) {
ModelNode store = cache.get(ModelKeys.STORE);
CacheLoaderManagerConfig storeManagerConfig = config.getCacheLoaderManagerConfig();
storeManagerConfig.setShared(store.hasDefined(ModelKeys.SHARED) ? store.get(ModelKeys.SHARED).asBoolean() : false);
storeManagerConfig.setPreload(store.hasDefined(ModelKeys.PRELOAD) ? store.get(ModelKeys.PRELOAD).asBoolean() : false);
storeManagerConfig.setPassivation(store.hasDefined(ModelKeys.PASSIVATION) ? store.get(ModelKeys.PASSIVATION).asBoolean() : true);
CacheStoreConfig storeConfig = this.createCacheLoaderConfig(store, locationInjectors);
storeConfig.getSingletonStoreConfig().setSingletonStoreEnabled(store.hasDefined(ModelKeys.SINGLETON) ? store.get(ModelKeys.SINGLETON).asBoolean() : false);
storeConfig.setFetchPersistentState(store.hasDefined(ModelKeys.FETCH_STATE) ? store.get(ModelKeys.FETCH_STATE).asBoolean() : true);
storeConfig.setPurgeOnStartup(store.hasDefined(ModelKeys.PURGE) ? store.get(ModelKeys.PURGE).asBoolean() : true);
if (store.hasDefined(ModelKeys.PROPERTY) && (storeConfig instanceof AbstractCacheStoreConfig)) {
Properties properties = new Properties();
for (Property property: store.get(ModelKeys.PROPERTY).asPropertyList()) {
properties.setProperty(property.getName(), property.getValue().asString());
}
((AbstractCacheStoreConfig) storeConfig).setProperties(properties);
}
storeManagerConfig.addCacheLoaderConfig(storeConfig);
}
configs.put(cacheName, config);
}
if (!configs.containsKey(defaultCache)) {
throw new IllegalArgumentException(String.format("%s is not a valid default cache. The %s cache container does not contain a cache with that name", defaultCache, name));