public abstract class CacheManager extends Object
Constructor and Description |
---|
CacheManager() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addCache(String group,
String key,
Object cache)
Adds item to cache.
|
void |
addCacheEventListener(CacheEventListener listener) |
abstract void |
doFlush(CacheEvent event) |
void |
flush(CacheEvent event)
Flashes cache.
|
void |
flush(CacheEvent event,
boolean propagate)
Flashes cache.
|
abstract Object |
getCache(String group,
String key)
Returns a cached item.
|
abstract Object |
getImplementation()
Returns underlying instance of implementation for specific configuration.
|
String |
getKey(String tableName,
String query,
Object[] params)
Generates a cache key.
|
void |
purgeTableCache(MetaModel metaModel)
This method purges (removes) all caches associated with a table, if caching is enabled and
a corresponding model is marked cached.
|
void |
purgeTableCache(String tableName)
Use
purgeTableCache(MetaModel) whenever you can. |
void |
removeAllCacheEventListeners() |
void |
removeCacheEventListener(CacheEventListener listener) |
public abstract Object getCache(String group, String key)
group
- group of caches - this is a name of a table for which query results are cachedkey
- key of the item.public abstract void addCache(String group, String key, Object cache)
group
- group name of cache.key
- key of the item.cache
- cache item to add to cache.public abstract void doFlush(CacheEvent event)
public final void flush(CacheEvent event, boolean propagate)
propagate
- true to propagate event to listeners, false to not propagateevent
- type of caches to flush.public final void flush(CacheEvent event)
event
- type of caches to flush.public final void addCacheEventListener(CacheEventListener listener)
public final void removeCacheEventListener(CacheEventListener listener)
public final void removeAllCacheEventListeners()
public void purgeTableCache(MetaModel metaModel)
metaModel
- meta-model whose caches are to purge.public void purgeTableCache(String tableName)
purgeTableCache(MetaModel)
whenever you can.tableName
- name of table whose caches to purge.public String getKey(String tableName, String query, Object[] params)
tableName
- name of a tablequery
- queryparams
- query parameters.public abstract Object getImplementation()
activejdbc.properties
file.
For instance:
redis.clients.jedis.JedisPool
.Copyright © 2020 JavaLite. All rights reserved.