ContentGrabbingJi/ContentGrabbingJi-CacheStore-api
LamGC a090abc9a4
[Change] CacheStore-API, CacheStore-Local, CacheStore-Redis 调整 MapCacheStore.putAll 方法参数;
[Change] MapCacheStore 调整 'putAll' 方法的泛型, 以兼容类型的子类;
[Change] HashMapCacheStore, RedisMapCacheStore 适配更改;
2021-01-12 06:39:48 +08:00
..
src [Change] CacheStore-API, CacheStore-Local, CacheStore-Redis 调整 MapCacheStore.putAll 方法参数; 2021-01-12 06:39:48 +08:00
pom.xml [Update][Fix] ALL 修正版权信息, 更新年份; 2021-01-01 18:26:20 +08:00
README.md [Update][Document] CacheStore-API 更新 Readme, 补充文档内容; 2020-10-09 00:37:20 +08:00

CacheStore-API

如需开发更多缓存组件,至少需要实现以下接口:

  • CacheStore / CollectionCacheStore
    • CacheStore 是所有缓存容器的父接口。
    • 这两个类为抽象接口,定义了部分具体接口的公共方法。
    • 不一定要单独实现该接口,可以直接实现具体的接口(比如 SingleCacheStore
  • CacheStoreFactory
    • 你还需要为其添加 @Factory 注解,否则不会生效。
  • SingleCacheStore / MapCacheStore / SetCacheStore / ListCacheStore
    • MapCacheStoreSetCacheStoreListCacheStoreCollectionCacheStore 的子类。
    • 至少需要提供其中一种实现才能算是一个有效的缓存组件。尚未实现的部分将会由其他组件代替。

完成缓存组件的开发后,应按照 SPI 机制的要求,设置所属 CacheStoreFactory 为 Service。

正常情况下,该模块不需要进行更改,即使需要更改,也需要保证向后兼容性。