|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.figure8.join.services.cache.EhCache
public class EhCache
Implementation of CacheManager
using EHCache provider
(see http://ehcache.sourceforge.net). It encapsulates a EH Cache.
Constructor Summary | |
---|---|
EhCache(java.lang.String key,
net.sf.ehcache.Cache ehcache,
net.sf.ehcache.CacheManager ehcacheManager)
Create a new instance of EhCache, wrapping a EH cache object. |
Method Summary | |
---|---|
void |
cleanUp()
Remove all elements from this cache and the cache itself. |
void |
clear()
Remove all elements from this cache but leave it in a usable state |
java.io.Serializable |
get(java.io.Serializable key)
Get the value of a cache element which matches the key |
java.util.List |
getElements()
Get all the elements of this cache. |
java.lang.String |
getKey()
Get the key this cache is registred within CacheManager |
net.sf.ehcache.Cache |
getWrappedCache()
|
void |
put(java.io.Serializable key,
java.io.Serializable value)
Puts an object into the cache |
void |
remove(java.io.Serializable key)
Remove an object from the cache |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EhCache(java.lang.String key, net.sf.ehcache.Cache ehcache, net.sf.ehcache.CacheManager ehcacheManager)
key
- The cache nameehcache
- The encapsulated EH cacheMethod Detail |
---|
public net.sf.ehcache.Cache getWrappedCache()
public java.lang.String getKey()
getKey
in interface Cache
public java.util.List getElements()
getElements
in interface Cache
public java.io.Serializable get(java.io.Serializable key)
get
in interface Cache
key
- The key of the element to return
public void put(java.io.Serializable key, java.io.Serializable value) throws CacheException
put
in interface Cache
key
- a serializable keyvalue
- a serializable value
CacheException
- if object cannot be put into cachepublic void remove(java.io.Serializable key) throws CacheException
remove
in interface Cache
key
- a serializable key
CacheException
- if something went wrong during removalpublic void clear() throws CacheException
clear
in interface Cache
CacheException
- if cache cannot be clearedpublic void cleanUp() throws CacheException
CacheManager
should no longer offer
access to this cache until explicit cache re-creation.
cleanUp
in interface Cache
CacheException
- if cache cannot be cleaned up
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |