public class EhcacheTransactionalDataRegion extends EhcacheDataRegion implements org.hibernate.cache.TransactionalDataRegion
This is the common superclass entity and collection regions.
Modifier and Type | Field and Description |
---|---|
private static int |
LOCAL_LOCK_PROVIDER_CONCURRENCY |
private CacheLockProvider |
lockProvider |
protected org.hibernate.cache.CacheDataDescription |
metadata
Metadata associated with the objects stored in the region.
|
protected org.hibernate.cfg.Settings |
settings
Hibernate settings associated with the persistence unit.
|
accessStrategyFactory, cache
Constructor and Description |
---|
EhcacheTransactionalDataRegion(EhcacheAccessStrategyFactory accessStrategyFactory,
Ehcache cache,
org.hibernate.cfg.Settings settings,
org.hibernate.cache.CacheDataDescription metadata,
java.util.Properties properties)
Construct an transactional Hibernate cache region around the given Ehcache instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all mapping from this cache region.
|
java.lang.Object |
get(java.lang.Object key)
Get the value mapped to this key, or null if no value is mapped to this key.
|
org.hibernate.cache.CacheDataDescription |
getCacheDataDescription() |
org.hibernate.cfg.Settings |
getSettings()
Return the hibernate settings
|
boolean |
isTransactionAware() |
boolean |
locksAreIndependentOfCache()
Returns
true if the locks used by the locking methods of this region are the independent of the cache. |
void |
put(java.lang.Object key,
java.lang.Object value)
Map the given value to the given key, replacing any existing mapping for this key
this unpins the key in the cache should it be currently pinned
|
private void |
put(java.lang.Object key,
java.lang.Object value,
boolean pinned) |
void |
putPinned(java.lang.Object key,
java.lang.Object value)
Map the given value to the given key, replacing any existing mapping for this key,
pinning the key in the cache
|
void |
readLock(java.lang.Object key)
Attempts to read lock the mapping for the given key.
|
void |
readUnlock(java.lang.Object key)
Attempts to read unlock the mapping for the given key.
|
void |
remove(java.lang.Object key)
Remove the mapping for this key (if any exists).
|
void |
writeLock(java.lang.Object key)
Attempts to write lock the mapping for the given key.
|
void |
writeUnlock(java.lang.Object key)
Attempts to write unlock the mapping for the given key.
|
contains, destroy, getEhcache, getElementCountInMemory, getElementCountOnDisk, getName, getSizeInMemory, getTimeout, nextTimestamp, toMap
private static final int LOCAL_LOCK_PROVIDER_CONCURRENCY
protected final org.hibernate.cfg.Settings settings
protected final org.hibernate.cache.CacheDataDescription metadata
private final CacheLockProvider lockProvider
EhcacheTransactionalDataRegion(EhcacheAccessStrategyFactory accessStrategyFactory, Ehcache cache, org.hibernate.cfg.Settings settings, org.hibernate.cache.CacheDataDescription metadata, java.util.Properties properties)
public org.hibernate.cfg.Settings getSettings()
public boolean isTransactionAware()
isTransactionAware
in interface org.hibernate.cache.TransactionalDataRegion
public org.hibernate.cache.CacheDataDescription getCacheDataDescription()
getCacheDataDescription
in interface org.hibernate.cache.TransactionalDataRegion
public final java.lang.Object get(java.lang.Object key)
public final void put(java.lang.Object key, java.lang.Object value) throws org.hibernate.cache.CacheException
org.hibernate.cache.CacheException
public final void putPinned(java.lang.Object key, java.lang.Object value) throws org.hibernate.cache.CacheException
org.hibernate.cache.CacheException
private void put(java.lang.Object key, java.lang.Object value, boolean pinned) throws org.hibernate.cache.CacheException
org.hibernate.cache.CacheException
public final void remove(java.lang.Object key) throws org.hibernate.cache.CacheException
org.hibernate.cache.CacheException
public final void clear() throws org.hibernate.cache.CacheException
org.hibernate.cache.CacheException
public final void writeLock(java.lang.Object key)
public final void writeUnlock(java.lang.Object key)
public final void readLock(java.lang.Object key)
public final void readUnlock(java.lang.Object key)
public final boolean locksAreIndependentOfCache()
true
if the locks used by the locking methods of this region are the independent of the cache.
Independent locks are not locked by the cache when the cache is accessed directly. This means that for an independent lock lock holds taken through a region method will not block direct access to the cache via other means.