JCS 是一款简单的内存缓存,基本使用如下
1、在 classpath 下配置 cache.ccf ,可以使用默认配置
jcs.default=
2、代码
package org.zln.jcs; import org.apache.jcs.JCS; import org.apache.jcs.access.exception.CacheException; import org.junit.Test; /** * Created by sherry on 16/9/18. */ public class JcsTest { @Test public void jcsWriteAndRead(){ try { JCS jcs = JCS.getInstance("cacheTest"); jcs.put("name","张柳宁"); String name = (String) jcs.get("name"); System.out.println("Name:"+name); } catch (CacheException e) { e.printStackTrace(); } } }
参考:
http://blog.csdn.net/huxu981598436/article/details/47020497
时间: 2024-10-13 02:35:33