|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.hibernate.EhCache
public final class EhCache
EHCache plugin for Hibernate.
EHCache uses aMemoryStore
and a
DiskStore
.
The DiskStore
requires that both keys and values be Serializable
.
However the MemoryStore does not and in ehcache-1.2 nonSerializable Objects are permitted. They are discarded
if an attempt it made to overflow them to Disk or to replicate them to remote cache peers.
Constructor Summary | |
---|---|
EhCache(Ehcache cache)
Creates a new Hibernate pluggable cache by 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. |
(package private) Ehcache |
getBackingCache()
Package protected method used for testing |
long |
getElementCountInMemory()
|
long |
getElementCountOnDisk()
|
java.lang.String |
getRegionName()
|
long |
getSizeInMemory()
Warning: This method can be very expensive to run. |
int |
getTimeout()
Returns the lock timeout for this cache, which is 60s |
void |
lock(java.lang.Object key)
Calls to this method should perform their own synchronization. |
long |
nextTimestamp()
Gets the next timestamp; |
void |
put(java.lang.Object key,
java.lang.Object value)
Puts an object into the cache. |
java.lang.Object |
read(java.lang.Object key)
Gets an object from the cache. |
void |
remove(java.lang.Object key)
Removes the element which matches the key. |
java.util.Map |
toMap()
|
java.lang.String |
toString()
|
void |
unlock(java.lang.Object key)
Calls to this method should perform their own synchronization. |
void |
update(java.lang.Object key,
java.lang.Object value)
Updates an object in the cache, or if it does not exist, inserts it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EhCache(Ehcache cache)
cache
- The backing ehcache cache.Method Detail |
---|
public final java.lang.Object get(java.lang.Object key) throws org.hibernate.cache.CacheException
get
in interface org.hibernate.cache.Cache
key
- the key of the element to return.
org.hibernate.cache.CacheException
public final java.lang.Object read(java.lang.Object key) throws org.hibernate.cache.CacheException
read
in interface org.hibernate.cache.Cache
key
- an Object value
org.hibernate.cache.CacheException
public final void update(java.lang.Object key, java.lang.Object value) throws org.hibernate.cache.CacheException
update
in interface org.hibernate.cache.Cache
key
- an Object keyvalue
- an Object value
org.hibernate.cache.CacheException
- if the CacheManager
is shutdown or another Exception
occurs.public final void put(java.lang.Object key, java.lang.Object value) throws org.hibernate.cache.CacheException
put
in interface org.hibernate.cache.Cache
key
- an Object keyvalue
- an Object value
org.hibernate.cache.CacheException
- if the CacheManager
is shutdown or another Exception
occurs.public final void remove(java.lang.Object key) throws org.hibernate.cache.CacheException
remove
in interface org.hibernate.cache.Cache
key
- the key of the element to remove
org.hibernate.cache.CacheException
public final void clear() throws org.hibernate.cache.CacheException
clear
in interface org.hibernate.cache.Cache
org.hibernate.cache.CacheException
public final void destroy() throws org.hibernate.cache.CacheException
destroy
in interface org.hibernate.cache.Cache
org.hibernate.cache.CacheException
public final void lock(java.lang.Object key) throws org.hibernate.cache.CacheException
lock
in interface org.hibernate.cache.Cache
org.hibernate.cache.CacheException
public final void unlock(java.lang.Object key) throws org.hibernate.cache.CacheException
unlock
in interface org.hibernate.cache.Cache
org.hibernate.cache.CacheException
public final long nextTimestamp()
nextTimestamp
in interface org.hibernate.cache.Cache
public final int getTimeout()
getTimeout
in interface org.hibernate.cache.Cache
public final java.lang.String getRegionName()
getRegionName
in interface org.hibernate.cache.Cache
public final long getSizeInMemory()
getSizeInMemory
in interface org.hibernate.cache.Cache
public final long getElementCountInMemory()
getElementCountInMemory
in interface org.hibernate.cache.Cache
public final long getElementCountOnDisk()
getElementCountOnDisk
in interface org.hibernate.cache.Cache
public final java.util.Map toMap()
toMap
in interface org.hibernate.cache.Cache
public final java.lang.String toString()
toString
in class java.lang.Object
final Ehcache getBackingCache()
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |