Package com.foxinmy.weixin4j.cache
Class CacheManager<T extends Cacheable>
- java.lang.Object
-
- com.foxinmy.weixin4j.cache.CacheManager<T>
-
- Direct Known Subclasses:
TokenManager
public class CacheManager<T extends Cacheable> extends Object
缓存管理类- Since:
- JDK 1.7
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected CacheCreator<T>
cacheCreator
protected CacheStorager<T>
cacheStorager
-
Constructor Summary
Constructors Constructor Description CacheManager(CacheCreator<T> cacheCreator, CacheStorager<T> cacheStorager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCache()
清除所有的缓存(请慎重)T
evictCache()
移除缓存T
getCache()
获取缓存对象T
refreshCache()
刷新缓存对象
-
-
-
Field Detail
-
cacheCreator
protected final CacheCreator<T extends Cacheable> cacheCreator
-
cacheStorager
protected final CacheStorager<T extends Cacheable> cacheStorager
-
-
Constructor Detail
-
CacheManager
public CacheManager(CacheCreator<T> cacheCreator, CacheStorager<T> cacheStorager)
-
-
Method Detail
-
getCache
public T getCache() throws WeixinException
获取缓存对象- Returns:
- 缓存对象
- Throws:
WeixinException
-
refreshCache
public T refreshCache() throws WeixinException
刷新缓存对象- Returns:
- 缓存对象
- Throws:
WeixinException
-
evictCache
public T evictCache()
移除缓存- Returns:
- 被移除的缓存对象
-
clearCache
public void clearCache()
清除所有的缓存(请慎重)
-
-