// 载入缓存信息 public static void putCacheInfo(String key, Cache obj, long dt, boolean expired) { Cache cache = new Cache(); cache.setKey(key); cache.setTimeOut(dt + System.currentTimeMillis()); // 设置多久后更新缓存 cache.setValue(obj); cache.setExpired(expired); // 缓存默认载入时,终止状态为FALSE cacheMap.put(key, cache); }
// 重写载入缓存信息方法 public static void putCacheInfo(String key, Cache obj, long dt) { Cache cache = new Cache(); cache.setKey(key); cache.setTimeOut(dt + System.currentTimeMillis()); cache.setValue(obj); cache.setExpired(false); cacheMap.put(key, cache); }