use of com.alicp.jetcache.CacheBuilder in project jetcache by alibaba.
the class AbstractCacheAutoInit method process.
private void process(String prefix, Map cacheBuilders, boolean local) {
RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(applicationContext.getEnvironment(), prefix);
Map<String, Object> m = resolver.getSubProperties("");
Set<String> cacheAreaNames = m.keySet().stream().map((s) -> s.substring(0, s.indexOf('.'))).collect(Collectors.toSet());
for (String cacheArea : cacheAreaNames) {
if (!typeName.equals(m.get(cacheArea + ".type"))) {
continue;
}
RelaxedPropertyResolver r = new RelaxedPropertyResolver(applicationContext.getEnvironment(), prefix + cacheArea + ".");
logger.info("init cache area {} , type= {}", cacheArea, typeName);
CacheBuilder c = initCache(r, local ? "local." + cacheArea : "remote." + cacheArea);
cacheBuilders.put(cacheArea, c);
}
}
Aggregations