public class OptimisticReadOnlyAccess extends OptimisticTransactionalAccess
region| Constructor and Description |
|---|
OptimisticReadOnlyAccess(EntityRegionImpl region) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
afterUpdate(Object key,
Object value,
Object currentVersion,
Object previousVersion,
SoftLock lock)
Called after an item has been updated (after the transaction completes),
instead of calling release().
|
SoftLock |
lockItem(Object key,
Object version)
We are going to attempt to update/delete the keyed object.
|
SoftLock |
lockRegion()
Lock the entire region
|
void |
unlockItem(Object key,
SoftLock lock)
Called when we have finished the attempted update/delete (which may or
may not have been successful), after transaction completion.
|
void |
unlockRegion(SoftLock lock)
Called after we have finished the attempted invalidation of the entire
region
|
boolean |
update(Object key,
Object value,
Object currentVersion,
Object previousVersion)
Called after an item has been updated (before the transaction completes),
instead of calling evict().
|
afterInsert, evict, evictAll, get, getRegion, insert, putFromLoad, putFromLoad, remove, removeAllpublic OptimisticReadOnlyAccess(EntityRegionImpl region)
public SoftLock lockItem(Object key, Object version) throws CacheException
EntityRegionAccessStrategylockItem in interface EntityRegionAccessStrategylockItem in class TransactionalAccesskey - The key of the item to lockversion - The item's current version valueCacheException - Propogated from underlying Regionpublic SoftLock lockRegion() throws CacheException
EntityRegionAccessStrategylockRegion in interface EntityRegionAccessStrategylockRegion in class TransactionalAccessCacheException - Propogated from underlying Regionpublic void unlockItem(Object key, SoftLock lock) throws CacheException
EntityRegionAccessStrategyunlockItem in interface EntityRegionAccessStrategyunlockItem in class TransactionalAccesskey - The item keylock - The lock previously obtained from EntityRegionAccessStrategy.lockItem(java.lang.Object, java.lang.Object)CacheException - Propogated from underlying Regionpublic void unlockRegion(SoftLock lock) throws CacheException
EntityRegionAccessStrategyunlockRegion in interface EntityRegionAccessStrategyunlockRegion in class TransactionalAccesslock - The lock previously obtained from EntityRegionAccessStrategy.lockRegion()CacheException - Propogated from underlying Regionpublic boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException
EntityRegionAccessStrategyupdate in interface EntityRegionAccessStrategyupdate in class TransactionalAccesskey - The item keyvalue - The itemcurrentVersion - The item's current version valuepreviousVersion - The item's previous version valueCacheException - Propogated from underlying Regionpublic boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException
EntityRegionAccessStrategyafterUpdate in interface EntityRegionAccessStrategyafterUpdate in class TransactionalAccesskey - The item keyvalue - The itemcurrentVersion - The item's current version valuepreviousVersion - The item's previous version valuelock - The lock previously obtained from EntityRegionAccessStrategy.lockItem(java.lang.Object, java.lang.Object)CacheException - Propogated from underlying RegionCopyright © 2002-2013 Red Hat Middleware, LLC. All Rights Reserved