-
Spring整合Java Memcached的代码实例
资源介绍
java Memcached客户端代码,整合到Spring,提供Util工具类
代码片段:
public class MemcachedUtils {
private static boolean setExp(String key, Object value, Date expire) {
boolean flag = false;
try {
flag = cachedClient.set(key, value, expire);
} catch (Exception e) {
// 记录Memcached日志
logger.error("Memcached set方法报错,key值:" + key + "\r\n");
}
return flag;
}