}
}
private CacheResult beforeDataAccess(Object[] args) throws CacheUnreachableException {
CacheResult cacheResult = new CacheResult(false);
CacheDefinition cacheDefinition = cacheDefinitionCollection.getCacheDefinition();
if (cacheDefinition == null) {
return cacheResult;
}
String key = cacheDefinition.generateCacheKey(args);
if (StringUtils.isEmpty(key)) {
LOGGER.debug("创建缓存KEY失败,不进行缓存!");
return cacheResult;
}
cacheResult.setKey(key);
Cache cache = cacheManager.getCache(cacheDefinition.getPool());
cacheResult.setCache(cache);
CacheObject oldItem = (CacheObject) cache.get(key);
LOGGER.debug("从" + key + "获取缓存对象:" + oldItem);
if (oldItem != null) {
return compareVersionKey(cacheDefinition, cacheResult, oldItem, args);