private Object getValue(String key, EHCacheManager ehCacheManager, EHCacheKey ehCacheKey) { long start = System.currentTimeMillis(); try { return ehCacheManager.getSerializableVal(key); } catch (Exception ex) { CacheLogger.error("getValue(" + key + ")", ex); // 反序列失败时,删除Cache ehCacheManager.delete(key); } finally { CacheLogger.writeSlowRequest(start, "EHCacheAnnotationProcess.getValue(" + key + ")"); } return null; }
private Object push( String key, Object value, EHCacheManager ehCacheManager, EHCacheKey ehCacheKey) { long start = System.currentTimeMillis(); try { ehCacheManager.addSerializableVal( key, (Serializable) value, ehCacheKey.isReload(), ehCacheKey.expire()); } catch (Exception ex) { CacheLogger.error("push(" + key + "," + value + ")", ex); } finally { CacheLogger.writeSlowRequest( start, "EHCacheAnnotationProcess.push(" + key + "," + value + ")"); } return value; }