[Change] CacheStore-local, CacheStore-redis 适配 CacheStore-API 模块的更改;

[Change] LocalCacheStoreFactory 适配更改;
[Change] RedisCacheStoreFactory 适配更改, 增加 Redis 配置文件相关逻辑;
[Change] RedisConnectionPool 增加 Redis 连接配置功能;
This commit is contained in:
2020-11-05 00:55:40 +08:00
parent b7d712da21
commit 4a2337afd7
3 changed files with 76 additions and 1 deletions

View File

@ -20,6 +20,8 @@ package net.lamgc.cgj.bot.cache.local;
import net.lamgc.cgj.bot.cache.*;
import net.lamgc.cgj.bot.cache.convert.StringConverter;
import java.io.File;
/**
* 本地缓存存储容器工厂.
* 最快速但又是最占内存的方法, 适用于远端缓存失效, 或无远端缓存的情况下使用.
@ -29,6 +31,11 @@ import net.lamgc.cgj.bot.cache.convert.StringConverter;
@Factory(name = "Local-Memory", priority = FactoryPriority.PRIORITY_LOWEST, source = CacheStoreSource.MEMORY)
public class LocalCacheStoreFactory implements CacheStoreFactory {
@Override
public void initial(File dataDirectory) {
// 不需要做任何事情, 除非需要做持久化.
}
@Override
public <V> SingleCacheStore<V> newSingleCacheStore(String identify, StringConverter<V> converter) {
return new HashSingleCacheStore<>();