use of com.alicp.jetcache.AbstractCacheBuilder in project jetcache by alibaba.
the class AbstractCacheAutoInit method parseGeneralConfig.
protected void parseGeneralConfig(CacheBuilder builder, RelaxedPropertyResolver resolver) {
AbstractCacheBuilder acb = (AbstractCacheBuilder) builder;
acb.keyConvertor(configProvider.parseKeyConvertor(resolver.getProperty("keyConvertor")));
String expireAfterWriteInMillis = resolver.getProperty("expireAfterWriteInMillis");
if (expireAfterWriteInMillis == null) {
// compatible with 2.1
expireAfterWriteInMillis = resolver.getProperty("defaultExpireInMillis");
}
if (expireAfterWriteInMillis != null) {
acb.setExpireAfterWriteInMillis(Long.parseLong(expireAfterWriteInMillis));
}
String expireAfterAccessInMillis = resolver.getProperty("expireAfterAccessInMillis");
if (expireAfterAccessInMillis != null) {
acb.setExpireAfterAccessInMillis(Long.parseLong(expireAfterAccessInMillis));
}
}
Aggregations