protected Ehcache decorateCache(Cache cache, EhCacheCachingModel model) {
if (model.getCacheEntryFactory() != null) {
if (model.getCacheEntryFactory() instanceof UpdatingCacheEntryFactory) {
return new UpdatingSelfPopulatingCache(cache, (UpdatingCacheEntryFactory) model.getCacheEntryFactory());
} else {
return new SelfPopulatingCache(cache, model.getCacheEntryFactory());
}
}
if (model.isBlocking()) {
return new BlockingCache(cache);
}