public abstract class AbstractCheckConfigCacheService extends Object implements CheckConfigCacheService
| 限定符和类型 | 字段和说明 |
|---|---|
private boolean |
alwaysLoadRemote |
private int |
capacity |
private com.google.common.cache.Cache<String,CheckConfig> |
configCache |
org.slf4j.Logger |
log |
private int |
maximumSize |
private RateLimiterCacheService |
rateLimiterCacheService |
(专用程序包) RulesParser |
rulesParser |
| 构造器和说明 |
|---|
AbstractCheckConfigCacheService() |
AbstractCheckConfigCacheService(boolean alwaysLoadRemote) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
清理缓存接口
|
CheckConfig |
get(String key)
根据缓存key获取校验配置信息接口
|
int |
getCapacity() |
int |
getMaximumSize() |
void |
init() |
private void |
initCache() |
CheckConfig |
parseCheckConfig(Check check,
String key)
解析校验配置
|
void |
remoteSetCallBack(String remote,
String val)
远程数据变更回调接口,当人为触发远程配置变更时调用
|
void |
setAlwaysLoadRemote(boolean alwaysLoadRemote) |
void |
setCapacity(int capacity) |
void |
setMaximumSize(int maximumSize) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitremoteGetprivate com.google.common.cache.Cache<String,CheckConfig> configCache
public final org.slf4j.Logger log
@Autowired private RateLimiterCacheService rateLimiterCacheService
@Autowired RulesParser rulesParser
private int capacity
private int maximumSize
private boolean alwaysLoadRemote
public AbstractCheckConfigCacheService(boolean alwaysLoadRemote)
public AbstractCheckConfigCacheService()
public void setAlwaysLoadRemote(boolean alwaysLoadRemote)
public void remoteSetCallBack(String remote, String val)
CheckConfigCacheServiceremoteSetCallBack 在接口中 CheckConfigCacheServiceremote - 远程配置key值val - 远程配置具体值public void clear()
CheckConfigCacheServiceclear 在接口中 CheckConfigCacheServiceprivate void initCache()
@PostConstruct public void init()
public int getCapacity()
public void setCapacity(int capacity)
public int getMaximumSize()
public void setMaximumSize(int maximumSize)
public CheckConfig get(String key)
CheckConfigCacheServiceget 在接口中 CheckConfigCacheServicekey - 校验配置public CheckConfig parseCheckConfig(Check check, String key)
CheckConfigCacheServiceparseCheckConfig 在接口中 CheckConfigCacheServicecheck - 校验注解key - 缓存key值Copyright © 2020. All rights reserved.