<学习笔记>缓存的使用

来源:互联网 发布:中信期货用哪个软件 编辑:程序博客网 时间:2024/05/17 03:49
public List<Microcode> getMicrocodeList() {
        List<Microcode> cache = (List<Microcode>) cacheBean.get(MICROCODE_KEY);
        if (null == cache) {
            cache = new ArrayList<Microcode>();
            log.debug("CachedObject[key:" + MICROCODE_KEY + "] will be refreshed.");
            List<Microcode> results = microcodeDao.findMicrocodeList();
            usingFilter(results);
            cache.addAll(results);
        }
        cacheBean.put(MICROCODE_KEY, cache);
        return cache;
    }
0 0
原创粉丝点击