|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.hibernate.cache.EhCache
EHCache plugin for Hibernate
EHCache uses a MemoryStore
and a
DiskStore
. The DiskStore
requires that both keys and values be Serializable
. For this reason
this plugin throws Exceptions when either of these are not castable to Serializable
.
Constructor Summary | |
EhCache(net.sf.ehcache.Cache cache)
Creates a new Hibernate pluggable cache based on a cache name. |
Method Summary | |
void |
clear()
Remove all elements in the cache, but leave the cache in a useable state. |
void |
destroy()
Remove the cache and make it unuseable. |
Object |
get(Object key)
Gets a value of an element which matches the given key. |
int |
getTimeout()
Returns the lock timeout for this cache. |
void |
lock(Object key)
Calls to this method should perform there own synchronization. |
long |
nextTimestamp()
Gets the next timestamp; |
void |
put(Object key,
Object value)
Puts an object into the cache. |
void |
remove(Object key)
Removes the element which matches the key. |
void |
unlock(Object key)
Calls to this method should perform there own synchronization. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EhCache(net.sf.ehcache.Cache cache)
cache
- The underlying EhCache instance to use.Method Detail |
public Object get(Object key) throws CacheException
key
- the key of the element to return.
CacheException
public void put(Object key, Object value) throws CacheException
key
- a Serializable
keyvalue
- a Serializable
value
CacheException
- if the parameters are not Serializable
, the CacheManager
is shutdown or another Exception
occurs.public void remove(Object key) throws CacheException
If no element matches, nothing is removed and no Exception is thrown.
key
- the key of the element to remove
CacheException
public void clear() throws CacheException
CacheException
public void destroy() throws CacheException
CacheException
public void lock(Object key) throws CacheException
CacheException
public void unlock(Object key) throws CacheException
CacheException
public long nextTimestamp()
nextTimestamp
in interface Cache
public int getTimeout()
getTimeout
in interface Cache
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |