| 构造器和说明 |
|---|
EhCache(net.sf.ehcache.Cache cache,
CacheExpiredListener listener)
Creates a new Hibernate pluggable cache based on a cache name.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
Remove all elements in the cache, but leave the cache
in a useable state.
|
Object |
clone() |
void |
destroy()
Remove the cache and make it unuseable.
|
void |
dispose() |
void |
evict(List keys)
Batch remove cache objects
|
void |
evict(Object key)
Removes the element which matches the key
If no element matches, nothing is removed and no Exception is thrown.
|
Object |
get(Object key)
Gets a value of an element which matches the given key.
|
List |
keys() |
void |
notifyElementEvicted(net.sf.ehcache.Ehcache arg0,
net.sf.ehcache.Element arg1) |
void |
notifyElementExpired(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element elem) |
void |
notifyElementPut(net.sf.ehcache.Ehcache arg0,
net.sf.ehcache.Element arg1) |
void |
notifyElementRemoved(net.sf.ehcache.Ehcache arg0,
net.sf.ehcache.Element arg1) |
void |
notifyElementUpdated(net.sf.ehcache.Ehcache arg0,
net.sf.ehcache.Element arg1) |
void |
notifyRemoveAll(net.sf.ehcache.Ehcache arg0) |
void |
put(Object key,
Object value)
Puts an object into the cache.
|
void |
update(Object key,
Object value)
Puts an object into the cache.
|
public EhCache(net.sf.ehcache.Cache cache,
CacheExpiredListener listener)
cache - The underlying EhCache instance to use.listener - cache listenerpublic List keys() throws CacheException
keys 在接口中 CacheCacheExceptionpublic Object get(Object key) throws CacheException
get 在接口中 Cachekey - the key of the element to return.CacheException - cache exceptionpublic void update(Object key, Object value) throws CacheException
update 在接口中 Cachekey - a keyvalue - a valueCacheException - if the CacheManager
is shutdown or another Exception occurs.public void put(Object key, Object value) throws CacheException
put 在接口中 Cachekey - a keyvalue - a valueCacheException - if the CacheManager
is shutdown or another Exception occurs.public void evict(Object key) throws CacheException
evict 在接口中 Cachekey - the key of the element to removeCacheException - cache exceptionpublic void evict(List keys) throws CacheException
Cacheevict 在接口中 Cachekeys - the cache keys to be evictedCacheExceptionpublic void clear()
throws CacheException
clear 在接口中 CacheCacheException - cache exceptionpublic void destroy()
throws CacheException
destroy 在接口中 CacheCacheException - cache exceptionpublic Object clone() throws CloneNotSupportedException
clone 在接口中 net.sf.ehcache.event.CacheEventListenerclone 在类中 ObjectCloneNotSupportedExceptionpublic void dispose()
dispose 在接口中 net.sf.ehcache.event.CacheEventListenerpublic void notifyElementEvicted(net.sf.ehcache.Ehcache arg0,
net.sf.ehcache.Element arg1)
notifyElementEvicted 在接口中 net.sf.ehcache.event.CacheEventListenerpublic void notifyElementExpired(net.sf.ehcache.Ehcache cache,
net.sf.ehcache.Element elem)
notifyElementExpired 在接口中 net.sf.ehcache.event.CacheEventListenerpublic void notifyElementPut(net.sf.ehcache.Ehcache arg0,
net.sf.ehcache.Element arg1)
throws net.sf.ehcache.CacheException
notifyElementPut 在接口中 net.sf.ehcache.event.CacheEventListenernet.sf.ehcache.CacheExceptionpublic void notifyElementRemoved(net.sf.ehcache.Ehcache arg0,
net.sf.ehcache.Element arg1)
throws net.sf.ehcache.CacheException
notifyElementRemoved 在接口中 net.sf.ehcache.event.CacheEventListenernet.sf.ehcache.CacheExceptionpublic void notifyElementUpdated(net.sf.ehcache.Ehcache arg0,
net.sf.ehcache.Element arg1)
throws net.sf.ehcache.CacheException
notifyElementUpdated 在接口中 net.sf.ehcache.event.CacheEventListenernet.sf.ehcache.CacheExceptionpublic void notifyRemoveAll(net.sf.ehcache.Ehcache arg0)
notifyRemoveAll 在接口中 net.sf.ehcache.event.CacheEventListenerCopyright © 2015. All rights reserved.