缓存框架java_java 缓存框架java caching system使用示例

要使用java caching system,需要下面这几个包:jcs.jar,concurrent.jar,commons-logging.jar, commons-lang.jar,commons-collection.jar这几个包,在java工程里面,

首先新建一个使用jcs的配置文件:cache.ccf,文件名不能改。

# DEFAULT CACHE REGION

# sets the default aux value for any non configured caches

jcs.default=

jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes

jcs.default.cacheattributes.MaxObjects=2000

jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache

jcs.default.elementattributes.IsEternal=false

jcs.default.elementattributes.MaxLifeSeconds=3600

jcs.default.elementattributes.IdleTime=1800

jcs.default.elementattributes.IsSpool=true

jcs.default.elementattributes.IsRemote=true

jcs.default.elementattributes.IsLateral=true

# CACHE REGIONS AVAILABLE

# Regions preconfigured for caching

jcs.region.bookCache=

jcs.region.bookCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes

jcs.region.bookCache.cacheattributes.MaxObjects=1200

jcs.region.bookCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache

jcs.region.bookCache.elementattributes.IsEternal=false

jcs.region.bookCache.elementattributes.MaxLifeSeconds=7200

jcs.region.bookCache.elementattributes.IdleTime=1800

jcs.region.bookCache.elementattributes.IsSpool=true

jcs.region.bookCache.elementattributes.IsRemote=true

jcs.region.bookCache.elementattributes.IsLateral=true

# AUXILIARY CACHES AVAILABLE

# Primary Disk Cache -- faster than the rest because of memory key storage

jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory

jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes

jcs.auxiliary.DC.attributes.DiskPath=/usr/opt/bookstore/raf

jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000

jcs.auxiliary.DC.attributes.MaxKeySize=10000

jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000

jcs.auxiliary.DC.attributes.Max

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值