|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.student.common.util.EhCacheHelper
public class EhCacheHelper
Simplified api for enabling Service and DAO classes with EhCache.
Constructor Summary | |
---|---|
EhCacheHelper()
|
|
EhCacheHelper(String configurationFileName)
|
Method Summary | |
---|---|
void |
createCache(String cacheName)
Creates a cache and adds it to the cache manager |
void |
evictAllCacheElements(String cacheName)
Remove all elements from cache |
void |
evictCacheElement(String cacheName,
String key)
Removes 1 element from cache |
net.sf.ehcache.Element |
getCacheElement(String cacheName,
String key)
Gets Element, useful for calling Element methods like getHitCount() |
long |
getCacheElementHitCount(net.sf.ehcache.Element element)
Gets how many times element has been accessed. |
Serializable |
getCacheElementValue(String cacheName,
String key)
Get the thing cached |
String[] |
getCacheNames()
|
void |
saveOrUpdateCacheElement(String cacheName,
String key,
Object value)
Like Hibernate's saveOrUpdate, this is used to create a new cache element and update existing element The cache knows if cache.put if creating or updating an element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EhCacheHelper()
public EhCacheHelper(String configurationFileName)
Method Detail |
---|
public void createCache(String cacheName)
cacheName
- you could name the cache with the classname that uses it.public void saveOrUpdateCacheElement(String cacheName, String key, Object value)
cacheName
- key
- must be unique, should be descriptivevalue
- the thing cachedpublic Serializable getCacheElementValue(String cacheName, String key)
cacheName
- key
-
public net.sf.ehcache.Element getCacheElement(String cacheName, String key)
cacheName
- key
-
public void evictCacheElement(String cacheName, String key)
cacheName
- key
- public void evictAllCacheElements(String cacheName)
cacheName
- public long getCacheElementHitCount(net.sf.ehcache.Element element)
element
-
public String[] getCacheNames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |