Package net.sf.ehcache.hibernate.regions
Class EhcacheTransactionalDataRegion
- java.lang.Object
-
- net.sf.ehcache.hibernate.regions.EhcacheDataRegion
-
- net.sf.ehcache.hibernate.regions.EhcacheTransactionalDataRegion
-
- All Implemented Interfaces:
org.hibernate.cache.Region,org.hibernate.cache.TransactionalDataRegion
- Direct Known Subclasses:
EhcacheCollectionRegion,EhcacheEntityRegion
public class EhcacheTransactionalDataRegion extends EhcacheDataRegion implements org.hibernate.cache.TransactionalDataRegion
An Ehcache specific TransactionalDataRegion.This is the common superclass entity and collection regions.
- Author:
- Chris Dennis, Greg Luck, Emmanuel Bernard, Abhishek Sanoujam
-
-
Field Summary
Fields Modifier and Type Field Description protected org.hibernate.cache.CacheDataDescriptionmetadataMetadata associated with the objects stored in the region.protected org.hibernate.cfg.SettingssettingsHibernate settings associated with the persistence unit.-
Fields inherited from class net.sf.ehcache.hibernate.regions.EhcacheDataRegion
accessStrategyFactory, cache
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Remove all mapping from this cache region.java.lang.Objectget(java.lang.Object key)Get the value mapped to this key, or null if no value is mapped to this key.org.hibernate.cache.CacheDataDescriptiongetCacheDataDescription()org.hibernate.cfg.SettingsgetSettings()Return the hibernate settingsbooleanisTransactionAware()booleanlocksAreIndependentOfCache()Returnstrueif the locks used by the locking methods of this region are the independent of the cache.voidput(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 pinnedvoidputEternal(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 cachevoidreadLock(java.lang.Object key)Attempts to read lock the mapping for the given key.voidreadUnlock(java.lang.Object key)Attempts to read unlock the mapping for the given key.voidremove(java.lang.Object key)Remove the mapping for this key (if any exists).voidwriteLock(java.lang.Object key)Attempts to write lock the mapping for the given key.voidwriteUnlock(java.lang.Object key)Attempts to write unlock the mapping for the given key.-
Methods inherited from class net.sf.ehcache.hibernate.regions.EhcacheDataRegion
contains, destroy, getEhcache, getElementCountInMemory, getElementCountOnDisk, getName, getSizeInMemory, getTimeout, nextTimestamp, toMap
-
-
-
-
Method Detail
-
getSettings
public org.hibernate.cfg.Settings getSettings()
Return the hibernate settings- Returns:
- settings
-
isTransactionAware
public boolean isTransactionAware()
- Specified by:
isTransactionAwarein interfaceorg.hibernate.cache.TransactionalDataRegion
-
getCacheDataDescription
public org.hibernate.cache.CacheDataDescription getCacheDataDescription()
- Specified by:
getCacheDataDescriptionin interfaceorg.hibernate.cache.TransactionalDataRegion
-
get
public final 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.
-
put
public final void put(java.lang.Object key, java.lang.Object value) throws org.hibernate.cache.CacheExceptionMap 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- Throws:
org.hibernate.cache.CacheException
-
putEternal
public final void putEternal(java.lang.Object key, java.lang.Object value) throws org.hibernate.cache.CacheExceptionMap the given value to the given key, replacing any existing mapping for this key, pinning the key in the cache- Throws:
org.hibernate.cache.CacheException
-
remove
public final void remove(java.lang.Object key) throws org.hibernate.cache.CacheExceptionRemove the mapping for this key (if any exists).- Throws:
org.hibernate.cache.CacheException
-
clear
public final void clear() throws org.hibernate.cache.CacheExceptionRemove all mapping from this cache region.- Throws:
org.hibernate.cache.CacheException
-
writeLock
public final void writeLock(java.lang.Object key)
Attempts to write lock the mapping for the given key.
-
writeUnlock
public final void writeUnlock(java.lang.Object key)
Attempts to write unlock the mapping for the given key.
-
readLock
public final void readLock(java.lang.Object key)
Attempts to read lock the mapping for the given key.
-
readUnlock
public final void readUnlock(java.lang.Object key)
Attempts to read unlock the mapping for the given key.
-
locksAreIndependentOfCache
public final boolean locksAreIndependentOfCache()
Returnstrueif 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.
-
-