use of com.agiletec.aps.system.services.lang.LangDOM in project entando-core by entando.
the class LangManagerCacheWrapper method initCache.
@Override
public void initCache(String xmlConfig) throws ApsSystemException {
try {
Cache cache = this.getCache();
this.releaseCachedObjects(cache);
LangDOM langDom = new LangDOM(xmlConfig);
Map<String, Lang> langMap = new HashMap<>();
List<Lang> systemLangs = langDom.getLangs();
for (Lang lang : systemLangs) {
if (lang.isDefault()) {
cache.put(LANG_DEFAULT_CACHE_NAME, lang);
}
langMap.put(lang.getCode(), lang);
}
super.insertObjectsOnCache(cache, langMap);
} catch (Throwable t) {
logger.error("Error loading the system langs", t);
throw new ApsSystemException("Error loading the system langs", t);
}
}
Aggregations