44 Star 95 Fork 39

joliny / atoms

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

基于j2cache的理念,重新设计开发的一套分布式缓存。。

github地址:atoms

Who's using 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

空文件

简介

基于j2cache的思想,重新开发的二级缓存系统 展开 收起
Java
取消

发行版 (6)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/jbakwd/atoms.git
git@gitee.com:jbakwd/atoms.git
jbakwd
atoms
atoms
master

搜索帮助