public class RedisCacheManager extends CacheManager
If redis server is located elsewhere, provide property files for different environments according to
AppConfig
rules.
See: AppConfig
for more information.
The environment-specific properties files have to have the following properties for this class to function:
redis.cache.manager.host
redis.cache.manager.port
localhost
and default
port for Redis.
Limitation: Does not support CacheManager.flush(CacheEvent)
with value 'ALL'.
Constructor and Description |
---|
RedisCacheManager() |
Modifier and Type | Method and Description |
---|---|
void |
addCache(String group,
String key,
Object cache)
Adds item to cache.
|
void |
doFlush(CacheEvent event) |
Object |
getCache(String group,
String key)
Returns a cached item.
|
Object |
getImplementation()
Returns underlying instance of implementation for specific configuration.
|
addCacheEventListener, flush, flush, getKey, purgeTableCache, purgeTableCache, removeAllCacheEventListeners, removeCacheEventListener
public Object getCache(String group, String key)
CacheManager
getCache
in class CacheManager
group
- group of caches - this is a name of a table for which query results are cachedkey
- key of the item.public void addCache(String group, String key, Object cache)
CacheManager
addCache
in class CacheManager
group
- group name of cache.key
- key of the item.cache
- cache item to add to cache.public void doFlush(CacheEvent event)
doFlush
in class CacheManager
public Object getImplementation()
CacheManager
getImplementation
in class CacheManager
activejdbc.properties
file.
For instance:
redis.clients.jedis.JedisPool
.Copyright © 2019 JavaLite. All rights reserved.