@Deprecated public final class EhCache extends Object implements org.hibernate.cache.Cache
MemoryStore 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 and Description |
|---|
EhCache(Ehcache cache)
Deprecated.
Creates a new Hibernate pluggable cache by name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canLockEntries()
Deprecated.
|
void |
clear()
Deprecated.
Remove all elements in the cache, but leave the cache in a useable state.
|
void |
destroy()
Deprecated.
Remove the cache and make it unuseable.
|
Object |
get(Object key)
Deprecated.
Gets a value of an element which matches the given key.
|
long |
getElementCountInMemory()
Deprecated.
|
long |
getElementCountOnDisk()
Deprecated.
|
String |
getRegionName()
Deprecated.
|
long |
getSizeInMemory()
Deprecated.
Warning: This method can be very expensive to run.
|
int |
getTimeout()
Deprecated.
Returns the lock timeout for this cache, which is 60s
|
void |
lock(Object key)
Deprecated.
|
long |
nextTimestamp()
Deprecated.
Gets the next timestamp;
|
void |
put(Object key,
Object value)
Deprecated.
Puts an object into the cache.
|
Object |
read(Object key)
Deprecated.
Gets an object from the cache.
|
void |
remove(Object key)
Deprecated.
Removes the element which matches the key.
|
Map |
toMap()
Deprecated.
|
String |
toString()
Deprecated.
|
void |
unlock(Object key)
Deprecated.
|
void |
update(Object key,
Object value)
Deprecated.
Updates an object in the cache, or if it does not exist, inserts it.
|
public EhCache(Ehcache cache)
cache - The backing ehcache cache.public final Object get(Object key) throws org.hibernate.cache.CacheException
get in interface org.hibernate.cache.Cachekey - the key of the element to return.org.hibernate.cache.CacheExceptionpublic final Object read(Object key) throws org.hibernate.cache.CacheException
read in interface org.hibernate.cache.Cachekey - an Object valueorg.hibernate.cache.CacheExceptionpublic final void update(Object key, Object value) throws org.hibernate.cache.CacheException
update in interface org.hibernate.cache.Cachekey - an Object keyvalue - an Object valueorg.hibernate.cache.CacheException - if the CacheManager is shutdown or another Exception occurs.public final void put(Object key, Object value) throws org.hibernate.cache.CacheException
put in interface org.hibernate.cache.Cachekey - an Object keyvalue - an Object valueorg.hibernate.cache.CacheException - if the CacheManager is shutdown or another Exception occurs.public final void remove(Object key) throws org.hibernate.cache.CacheException
remove in interface org.hibernate.cache.Cachekey - the key of the element to removeorg.hibernate.cache.CacheExceptionpublic final void clear()
throws org.hibernate.cache.CacheException
clear in interface org.hibernate.cache.Cacheorg.hibernate.cache.CacheExceptionpublic final void destroy()
throws org.hibernate.cache.CacheException
destroy in interface org.hibernate.cache.Cacheorg.hibernate.cache.CacheExceptionpublic final void lock(Object key) throws org.hibernate.cache.CacheException
lock in interface org.hibernate.cache.Cacheorg.hibernate.cache.CacheExceptionpublic final void unlock(Object key) throws org.hibernate.cache.CacheException
unlock in interface org.hibernate.cache.Cacheorg.hibernate.cache.CacheExceptionpublic final long nextTimestamp()
nextTimestamp in interface org.hibernate.cache.Cachepublic final int getTimeout()
getTimeout in interface org.hibernate.cache.Cachepublic final String getRegionName()
getRegionName in interface org.hibernate.cache.Cachepublic final long getSizeInMemory()
getSizeInMemory in interface org.hibernate.cache.Cachepublic final long getElementCountInMemory()
getElementCountInMemory in interface org.hibernate.cache.Cachepublic final long getElementCountOnDisk()
getElementCountOnDisk in interface org.hibernate.cache.Cachepublic final Map toMap()
toMap in interface org.hibernate.cache.Cachepublic final boolean canLockEntries()
true if this cache supports entry locks.Copyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.