public abstract class AbstractReadWriteAccessStrategy extends BaseRegionAccessStrategy
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractReadWriteAccessStrategy.Item
Wrapper type representing unlocked items.
|
static class |
AbstractReadWriteAccessStrategy.Lock
Wrapper type representing locked items.
|
static interface |
AbstractReadWriteAccessStrategy.Lockable
Interface type implemented by all wrapper objects in the cache.
|
| Modifier and Type | Field and Description |
|---|---|
protected Lock |
readLock |
protected Lock |
writeLock |
| Constructor and Description |
|---|
AbstractReadWriteAccessStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
decrementLock(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
AbstractReadWriteAccessStrategy.Lock lock)
Unlock and re-put the given key, lock combination.
|
Object |
get(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
long txTimestamp)
Returns <code>null</code> if the item is not readable.
|
protected void |
handleLockExpiry(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
AbstractReadWriteAccessStrategy.Lockable lock)
Handle the timeout of a previous lock mapped to this key
|
org.hibernate.cache.spi.access.SoftLock |
lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
Object version)
Soft-lock a cache item.
|
boolean |
putFromLoad(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
Object value,
long txTimestamp,
Object version,
boolean minimalPutOverride)
Returns <code>false</code> and fails to put the value if there is an existing un-writeable item mapped to this
key.
|
void |
unlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
org.hibernate.cache.spi.access.SoftLock lock)
Soft-unlock a cache item.
|
evict, evictAll, getInternalRegion, isDefaultMinimalPutOverride, lockRegion, putFromLoad, remove, removeAll, unlockRegionpublic final Object get(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, long txTimestamp) throws org.hibernate.cache.CacheException
Returns <code>null</code> if the item is not readable. Locked items are not readable, nor are items created after the start of this transaction.
get in interface org.hibernate.cache.spi.access.RegionAccessStrategyget in class BaseRegionAccessStrategyorg.hibernate.cache.CacheExceptionpublic final boolean putFromLoad(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
Object value,
long txTimestamp,
Object version,
boolean minimalPutOverride)
throws org.hibernate.cache.CacheException
Returns <code>false</code> and fails to put the value if there is an existing un-writeable item mapped to this key.
putFromLoad in interface org.hibernate.cache.spi.access.RegionAccessStrategyputFromLoad in class BaseRegionAccessStrategyorg.hibernate.cache.CacheExceptionpublic final org.hibernate.cache.spi.access.SoftLock lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
Object version)
throws org.hibernate.cache.CacheException
Soft-lock a cache item.
lockItem in interface org.hibernate.cache.spi.access.RegionAccessStrategylockItem in class BaseRegionAccessStrategyorg.hibernate.cache.CacheExceptionpublic final void unlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
org.hibernate.cache.spi.access.SoftLock lock)
throws org.hibernate.cache.CacheException
Soft-unlock a cache item.
unlockItem in interface org.hibernate.cache.spi.access.RegionAccessStrategyunlockItem in class BaseRegionAccessStrategyorg.hibernate.cache.CacheExceptionprotected void decrementLock(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
AbstractReadWriteAccessStrategy.Lock lock)
Unlock and re-put the given key, lock combination.
protected void handleLockExpiry(org.hibernate.engine.spi.SharedSessionContractImplementor session,
Object key,
AbstractReadWriteAccessStrategy.Lockable lock)
Handle the timeout of a previous lock mapped to this key
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.