|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ehcache.hibernate.Plugin
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 | |
Plugin(java.lang.String name)
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. |
java.lang.Object |
get(java.lang.Object key)
Gets a value of an element which matches the given key. |
int |
getTimeout()
Returns the lock timeout for this cache. |
void |
lock(java.lang.Object key)
Calls to this method should perform there own synchronization. |
long |
nextTimestamp()
Gets the next timestamp; |
void |
put(java.lang.Object key,
java.lang.Object value)
Puts an object into the cache. |
void |
remove(java.lang.Object key)
Removes the element which matches the key. |
void |
unlock(java.lang.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 Plugin(java.lang.String name) throws net.sf.hibernate.cache.CacheException
name
- the name of the cache. This cache must have already been configured.
net.sf.hibernate.cache.CacheException
- If there is no cache with the given name.Method Detail |
public java.lang.Object get(java.lang.Object key) throws net.sf.hibernate.cache.CacheException
get
in interface net.sf.hibernate.cache.Cache
key
- the key of the element to return.
net.sf.hibernate.cache.CacheException
public void put(java.lang.Object key, java.lang.Object value) throws net.sf.hibernate.cache.CacheException
put
in interface net.sf.hibernate.cache.Cache
key
- a Serializable
keyvalue
- a Serializable
value
net.sf.hibernate.cache.CacheException
- if the parameters are not Serializable
, the CacheManager
is shutdown or another Exception
occurs.public void remove(java.lang.Object key) throws net.sf.hibernate.cache.CacheException
If no element matches, nothing is removed and no Exception is thrown.
remove
in interface net.sf.hibernate.cache.Cache
key
- the key of the element to remove
net.sf.hibernate.cache.CacheException
public void clear() throws net.sf.hibernate.cache.CacheException
clear
in interface net.sf.hibernate.cache.Cache
net.sf.hibernate.cache.CacheException
public void destroy() throws net.sf.hibernate.cache.CacheException
destroy
in interface net.sf.hibernate.cache.Cache
net.sf.hibernate.cache.CacheException
public void lock(java.lang.Object key) throws net.sf.hibernate.cache.CacheException
lock
in interface net.sf.hibernate.cache.Cache
net.sf.hibernate.cache.CacheException
public void unlock(java.lang.Object key) throws net.sf.hibernate.cache.CacheException
unlock
in interface net.sf.hibernate.cache.Cache
net.sf.hibernate.cache.CacheException
public long nextTimestamp()
nextTimestamp
in interface net.sf.hibernate.cache.Cache
public int getTimeout()
getTimeout
in interface net.sf.hibernate.cache.Cache
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |