类 AbstractReadWriteAccess
- java.lang.Object
-
- org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
-
- org.hibernate.cache.spi.support.AbstractReadWriteAccess
-
public abstract class AbstractReadWriteAccess extends AbstractCachedDomainDataAccess
- 作者:
- Steve Ebersole
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classAbstractReadWriteAccess.ItemWrapper type representing unlocked items.static interfaceAbstractReadWriteAccess.LockableInterface type implemented by all wrapper objects in the cache.static classAbstractReadWriteAccess.SoftLockImplWrapper type representing locked items.
-
构造器概要
构造器 限定符 构造器 说明 protectedAbstractReadWriteAccess(DomainDataRegion domainDataRegion, DomainDataStorageAccess storageAccess)
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected voiddecrementLock(SharedSessionContractImplementor session, Object key, AbstractReadWriteAccess.SoftLockImpl lock)Objectget(SharedSessionContractImplementor session, Object key)Returnsnullif the item is not readable.protected abstract AccessedDataClassificationgetAccessedDataClassification()protected abstract ComparatorgetVersionComparator()protected voidhandleLockExpiry(SharedSessionContractImplementor session, Object key, AbstractReadWriteAccess.Lockable lock)SoftLocklockItem(SharedSessionContractImplementor session, Object key, Object version)We are going to attempt to update/delete the keyed object.protected longnextLockId()booleanputFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version)Attempt to cache an object, afterQuery loading from the database.booleanputFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version, boolean minimalPutOverride)Attempt to cache an object, afterQuery loading from the database, explicitly specifying the minimalPut behavior.protected LockreadLock()voidremove(SharedSessionContractImplementor session, Object key)Called afterQuery an item has become stale (beforeQuery the transaction completes).voidremoveAll(SharedSessionContractImplementor session)Remove all data for this accessed typevoidunlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock)Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion.protected UUIDuuid()protected LockwriteLock()-
从类继承的方法 org.hibernate.cache.spi.support.AbstractCachedDomainDataAccess
clearCache, contains, destroy, evict, evictAll, getRegion, getStorageAccess, lockRegion, unlockRegion
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.cache.spi.access.CachedDomainDataAccess
getAccessType
-
-
-
-
构造器详细资料
-
AbstractReadWriteAccess
protected AbstractReadWriteAccess(DomainDataRegion domainDataRegion, DomainDataStorageAccess storageAccess)
-
-
方法详细资料
-
getVersionComparator
protected abstract Comparator getVersionComparator()
-
uuid
protected UUID uuid()
-
nextLockId
protected long nextLockId()
-
readLock
protected Lock readLock()
-
writeLock
protected Lock writeLock()
-
get
public Object get(SharedSessionContractImplementor session, Object key)
Returnsnullif the item is not readable. Locked items are not readable, nor are items created afterQuery the start of this transaction.- 指定者:
get在接口中CachedDomainDataAccess- 覆盖:
get在类中AbstractCachedDomainDataAccess- 参数:
session- Current session.key- The key of the item to be retrieved.- 返回:
- the cached data or
null
-
putFromLoad
public boolean putFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version)
从接口复制的说明:CachedDomainDataAccessAttempt to cache an object, afterQuery loading from the database.- 指定者:
putFromLoad在接口中CachedDomainDataAccess- 覆盖:
putFromLoad在类中AbstractCachedDomainDataAccess- 参数:
session- Current session.key- The item keyvalue- The itemversion- the item version number- 返回:
trueif the object was successfully cached
-
getAccessedDataClassification
protected abstract AccessedDataClassification getAccessedDataClassification()
-
putFromLoad
public final boolean putFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version, boolean minimalPutOverride)
从接口复制的说明:CachedDomainDataAccessAttempt to cache an object, afterQuery loading from the database, explicitly specifying the minimalPut behavior.- 指定者:
putFromLoad在接口中CachedDomainDataAccess- 覆盖:
putFromLoad在类中AbstractCachedDomainDataAccess- 参数:
session- Current session.key- The item keyvalue- The itemversion- the item version numberminimalPutOverride- Explicit minimalPut flag- 返回:
trueif the object was successfully cached
-
lockItem
public SoftLock lockItem(SharedSessionContractImplementor session, Object key, Object version)
从接口复制的说明:CachedDomainDataAccessWe are going to attempt to update/delete the keyed object. This method is used by "asynchronous" concurrency strategies. The returned object must be passed back toCachedDomainDataAccess.unlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, org.hibernate.cache.spi.access.SoftLock), to release the lock. Concurrency strategies which do not support client-visible locks may silently return null.- 参数:
session- Current session.key- The key of the item to lockversion- The item's current version value- 返回:
- A representation of our lock on the item; or
null.
-
unlockItem
public void unlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock)
从接口复制的说明:CachedDomainDataAccessCalled when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion. This method is used by "asynchronous" concurrency strategies.- 参数:
session- Current session.key- The item keylock- The lock previously obtained fromCachedDomainDataAccess.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)
-
decrementLock
protected void decrementLock(SharedSessionContractImplementor session, Object key, AbstractReadWriteAccess.SoftLockImpl lock)
-
handleLockExpiry
protected void handleLockExpiry(SharedSessionContractImplementor session, Object key, AbstractReadWriteAccess.Lockable lock)
-
remove
public void remove(SharedSessionContractImplementor session, Object key)
从接口复制的说明:CachedDomainDataAccessCalled afterQuery an item has become stale (beforeQuery the transaction completes). This method is used by "synchronous" concurrency strategies.- 指定者:
remove在接口中CachedDomainDataAccess- 覆盖:
remove在类中AbstractCachedDomainDataAccess- 参数:
session- Current session.key- The key of the item to remove
-
removeAll
public void removeAll(SharedSessionContractImplementor session)
从接口复制的说明:CachedDomainDataAccessRemove all data for this accessed type- 指定者:
removeAll在接口中CachedDomainDataAccess- 覆盖:
removeAll在类中AbstractCachedDomainDataAccess
-
-