# xcache
**Repository Path**: ali_studio/xcache
## Basic Information
- **Project Name**: xcache
- **Description**: Cache Framework
- **Primary Language**: Java
- **License**: Not specified
- **Default Branch**: dev
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2023-03-29
- **Last Updated**: 2023-03-29
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 缓存框架V1.0.3
对缓冲层的抽象,简化缓存使用;可接入本地缓存和第三方缓存
未指定localCache和remoteCache或者需缓存返回对象的方法的参数为空,则不做任何操作
CacheManager为主要操作类,单例实现,可单独使用,如:
CacheManager cm=CacheManager.getInstance();
cm.putToRemote(key,value);
cm.removeRemote(shardName,key);
###版本变更记录
| 版本 | 日期 | 描述 |
|---|---|---|
| V1.0.0 | 2017-06-06 | 完成预期功能,可投入使用 |
| V1.0.1 | 2017-08-01 | 支持分片 |
| V1.0.2 | 2017-11-06 | 包结构重置;LOGGER分离 |
| V1.0.3 | 2018-04-25 | 新增自定义Schema |
| xcache.bean.SingleMapCache | 单Map实现,不自动清理,线程安全 |
| xcache.bean.SingleMapAutoCleanCache | 单Map实现,可自动清理过期内容,线程安全 |
| xcache.bean.MultiMapCache | 双Map实现,不自动清理,线程安全 |
| xcache.bean.MultiMapAutoCleanCache | 双Map实现,可自动清理过期内容,线程安全 |
| xcache.bean.LRUCache | 单LURMap实现,不自动清理,线程安全 |
| xcache.bean.MultiLRUCache | 双LURMap实现,不自动清理,线程安全 |
| xcache.bean.EHCache | 基于Ehcache实现的Cache |
| xcache.redis.SingleRedisCache | 基于Spring的RedisTemplate实现 |
| xcache.redis.SingleRedisShardCache | 基于Spring的RedisTemplate实现;可指定数据库ID |
| xcache.redis.RedisClusterCache(未实现) | 基于Redis集群实现 |
| 参数名 | 类型 | 默认值 | 描述 |
| key | String | 空 |
缓存主键生成方式,三种方式: 1.不指定;以方法的第一个参数dump成字符串作为key 2.SpEL;表达式引用参数名称正确则解析,否则将表达式以字符串形式作为key;若多个参数名称相同,则取第一个参数参与表达式运算 3.字符串形式,直接作为key |
| shardName | String | 空 | 数据库分库名;目前仅Redis使用,用于指定数据库下标 |
| remove | String数组 | 空 | 触发缓存清理的方法名;匹配所有重载的方法 |
| throwable | Boolean | false | 是否抛出缓存操作时的异常 |
| expiring | Integer | 0 | 有效期 |
| timeUnit | xcache.em.TimeUnit | MINUTE | 有效期单位 |
| prefix | String | 空 | key前缀 |
| suffix | String | 空 | key后缀 |