public abstract class EhcacheDataRegion
extends java.lang.Object
implements org.hibernate.cache.Region
This class is the ultimate superclass for all Ehcache Hibernate cache regions.
Modifier and Type | Field and Description |
---|---|
protected EhcacheAccessStrategyFactory |
accessStrategyFactory
The
EhcacheAccessStrategyFactory used for creating various access strategies |
protected Ehcache |
cache
Ehcache instance backing this Hibernate data region.
|
private static java.lang.String |
CACHE_LOCK_TIMEOUT_PROPERTY |
private int |
cacheLockTimeout |
private static int |
DEFAULT_CACHE_LOCK_TIMEOUT |
private static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
EhcacheDataRegion(EhcacheAccessStrategyFactory accessStrategyFactory,
Ehcache cache,
java.util.Properties properties)
Create a Hibernate data region backed by the given Ehcache instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.Object key)
Returns
true if this region contains data for the given key. |
void |
destroy() |
Ehcache |
getEhcache()
Return the Ehcache instance backing this Hibernate data region.
|
long |
getElementCountInMemory() |
long |
getElementCountOnDisk() |
java.lang.String |
getName() |
long |
getSizeInMemory() |
int |
getTimeout() |
long |
nextTimestamp() |
java.util.Map |
toMap() |
private static final org.slf4j.Logger LOG
private static final java.lang.String CACHE_LOCK_TIMEOUT_PROPERTY
private static final int DEFAULT_CACHE_LOCK_TIMEOUT
protected final Ehcache cache
protected final EhcacheAccessStrategyFactory accessStrategyFactory
EhcacheAccessStrategyFactory
used for creating various access strategiesprivate final int cacheLockTimeout
EhcacheDataRegion(EhcacheAccessStrategyFactory accessStrategyFactory, Ehcache cache, java.util.Properties properties)
public java.lang.String getName()
getName
in interface org.hibernate.cache.Region
public void destroy() throws org.hibernate.cache.CacheException
destroy
in interface org.hibernate.cache.Region
org.hibernate.cache.CacheException
public long getSizeInMemory()
getSizeInMemory
in interface org.hibernate.cache.Region
public long getElementCountInMemory()
getElementCountInMemory
in interface org.hibernate.cache.Region
public long getElementCountOnDisk()
getElementCountOnDisk
in interface org.hibernate.cache.Region
public java.util.Map toMap()
toMap
in interface org.hibernate.cache.Region
public long nextTimestamp()
nextTimestamp
in interface org.hibernate.cache.Region
public int getTimeout()
getTimeout
in interface org.hibernate.cache.Region
public Ehcache getEhcache()
public boolean contains(java.lang.Object key)
true
if this region contains data for the given key.
This is a Hibernate 3.5 method.
contains
in interface org.hibernate.cache.Region