类 RedisCacheProvider<T>
java.lang.Object
com.walker.cache.AbstractCacheProvider<T>
com.walker.support.redis.cache.RedisCacheProvider<T>
- 类型参数:
T-
- 所有已实现的接口:
CacheProvider<T>,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<CacheProvider<T>>,org.springframework.beans.factory.InitializingBean
Redis方式缓存提供者实现
- 作者:
- shikeying
-
字段概要
从类继承的字段 com.walker.cache.AbstractCacheProvider
count, logger, userCache从接口继承的字段 org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voiddestroy()longgetCacheData(String key) protected RedisCachegetRedisRootData(String key) 已过时。booleanprotected intloadDataToCache(Cache cache) protected CacheprovideCacheInstance(String name, Map<String, String> param) voidputCacheData(String key, T data) voidputCacheData(String key, T data, long expiredSeconds) 添加支持数据过期的缓存方法。voidreload()voidremoveCacheData(String key) voidsetRedisHelper(RedisHelper redisHelper) voidsetSupportExpiredCache(boolean supportExpiredCache) 设置是否支持缓存失效,因为redis失效是针对key,因此HashMap方式是作为整体失效的!voidupdateCacheData(String key, T data) 从类继承的方法 com.walker.cache.AbstractCacheProvider
afterPropertiesSet, getCache, getCacheList, getCacheParam, getCreateTime, getObject, getObjectType, isLoadPage, isSingleton, isUseRedis, loadPageDataToCache, putCacheList, putCacheList, putCacheListAppend, queryListLimit, removeCacheList, removeCacheList, setCacheParam, setLoadPage, setPageSize, setUseRedis, size, toString从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 com.walker.cache.CacheProvider
getProviderName, getProviderType
-
构造器详细资料
-
RedisCacheProvider
public RedisCacheProvider()
-
-
方法详细资料
-
setRedisHelper
-
provideCacheInstance
- 覆盖:
provideCacheInstance在类中AbstractCacheProvider<T>
-
destroy
- 指定者:
destroy在接口中org.springframework.beans.factory.DisposableBean- 覆盖:
destroy在类中AbstractCacheProvider<T>- 抛出:
Exception
-
loadDataToCache
- 指定者:
loadDataToCache在类中AbstractCacheProvider<T>
-
getCacheData
- 指定者:
getCacheData在接口中CacheProvider<T>- 覆盖:
getCacheData在类中AbstractCacheProvider<T>
-
getRedisCache
-
getCacheCount
public long getCacheCount()- 指定者:
getCacheCount在接口中CacheProvider<T>- 覆盖:
getCacheCount在类中AbstractCacheProvider<T>
-
removeCacheData
- 指定者:
removeCacheData在接口中CacheProvider<T>- 覆盖:
removeCacheData在类中AbstractCacheProvider<T>
-
updateCacheData
- 指定者:
updateCacheData在接口中CacheProvider<T>- 覆盖:
updateCacheData在类中AbstractCacheProvider<T>
-
putCacheData
- 指定者:
putCacheData在接口中CacheProvider<T>- 覆盖:
putCacheData在类中AbstractCacheProvider<T>
-
putCacheData
添加支持数据过期的缓存方法。- 指定者:
putCacheData在接口中CacheProvider<T>- 覆盖:
putCacheData在类中AbstractCacheProvider<T>- 参数:
key-data-expiredSeconds- 过期秒数
-
reload
- 指定者:
reload在接口中CacheProvider<T>- 覆盖:
reload在类中AbstractCacheProvider<T>- 抛出:
Exception
-
getRedisRootData
已过时。缓存对象不再需要单独根下面的独立的key方式。- 参数:
key-- 返回:
-
isSupportExpiredCache
public boolean isSupportExpiredCache() -
setSupportExpiredCache
public void setSupportExpiredCache(boolean supportExpiredCache) 设置是否支持缓存失效,因为redis失效是针对key,因此HashMap方式是作为整体失效的!1) 默认不支持缓存失效,此时使用Map方式存储数据 2) 当设置运行失效时,必须采用字符串形式的数据结构 3) 该选项只对hashmap数据结构有效。- 参数:
supportExpiredCache-
-