代码拉取完成,页面将自动刷新
同步操作将从 joliny/atoms 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
基于j2cache的理念,重新设计开发的一套分布式缓存。。
github地址:atoms
[职通网] (http://www.zhitongjob.com)
配置文件
<?xml version="1.0" encoding="UTF-8"?>
<atoms>
<broadcast type="redis" >
<broadcastConfig host="192.168.1.53" port="6379"/>
</broadcast>
<serializer type="fst"/>
<cache level="1" type="ehcache" delete_atom="true" ><!-- expiredOperator="update" waitTime="100" --><!-- expiredOperator: update,delete 当为update时waitTime有效-->
<cacheConfig configFile="ehcache.xml"/>
<cacheTTL>
<ttl name="hello" value="1000"/><!-- name:regionName value:失效时间 单位(秒) -->
</cacheTTL>
</cache>
<cache level="2" type="redis">
<cacheConfig host="192.168.1.53" port="6379" timeout="2000" database="13" namespace="atoms" maxTotal="-1" maxIdle="2000"
maxWaitMillis="100" minEvictableIdleTimeMillis="864000000" minIdle="1000" numTestsPerEvictionRun="10" lifo="false"
softMinEvictableIdleTimeMillis="10" testOnBorrow="true" testOnReturn="false" testWhileIdle="false" timeBetweenEvictionRunsMillis="300000"
blockWhenExhausted="true" password=""/>
<cacheTTL>
<ttl name="hello" value="3000"/><!-- name:regionName value:失效时间 单位(秒) -->
</cacheTTL>
</cache>
</atoms>
使用代码:
CacheChannel cc=CacheChannel.getInstance();
cc.set("jobell", "hello", "nihaoya");
cc.evict("jobell", "hello");
while(true){
Object value=cc.get("jobell", "hello");
if(value==null){
System.out.println("==============="+value);
}else{
System.out.println("==============="+value);
}
}
Spring配置参考atoms-config/src/test/resources/applicationContext.xml
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。