|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.cache.jbc2.entity.TransactionalAccess org.hibernate.cache.jbc2.entity.OptimisticTransactionalAccess org.hibernate.cache.jbc2.entity.OptimisticReadOnlyAccess
public class OptimisticReadOnlyAccess
This defines the strategy for read-only access to enity data in an optimistic-locking JBossCache using its 2.x APIs
The read-only access to a JBossCache really is still transactional, just with the extra semantic or guarantee that we will not update data.
Field Summary |
---|
Fields inherited from class org.hibernate.cache.jbc2.entity.TransactionalAccess |
---|
region |
Constructor Summary | |
---|---|
OptimisticReadOnlyAccess(EntityRegionImpl region)
|
Method Summary | |
---|---|
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(). |
Methods inherited from class org.hibernate.cache.jbc2.entity.TransactionalAccess |
---|
afterInsert, evict, evictAll, get, getRegion, insert, putFromLoad, putFromLoad, remove, removeAll |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OptimisticReadOnlyAccess(EntityRegionImpl region)
Method Detail |
---|
public SoftLock lockItem(Object key, Object version) throws CacheException
EntityRegionAccessStrategy
lockItem
in interface EntityRegionAccessStrategy
lockItem
in class TransactionalAccess
key
- The key of the item to lockversion
- The item's current version value
CacheException
- Propogated from underlying Region
public SoftLock lockRegion() throws CacheException
EntityRegionAccessStrategy
lockRegion
in interface EntityRegionAccessStrategy
lockRegion
in class TransactionalAccess
CacheException
- Propogated from underlying Region
public void unlockItem(Object key, SoftLock lock) throws CacheException
EntityRegionAccessStrategy
unlockItem
in interface EntityRegionAccessStrategy
unlockItem
in class TransactionalAccess
key
- The item keylock
- The lock previously obtained from EntityRegionAccessStrategy.lockItem(java.lang.Object, java.lang.Object)
CacheException
- Propogated from underlying Region
public void unlockRegion(SoftLock lock) throws CacheException
EntityRegionAccessStrategy
unlockRegion
in interface EntityRegionAccessStrategy
unlockRegion
in class TransactionalAccess
lock
- The lock previously obtained from EntityRegionAccessStrategy.lockRegion()
CacheException
- Propogated from underlying Region
public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException
EntityRegionAccessStrategy
update
in interface EntityRegionAccessStrategy
update
in class TransactionalAccess
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version value
CacheException
- Propogated from underlying Region
public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException
EntityRegionAccessStrategy
afterUpdate
in interface EntityRegionAccessStrategy
afterUpdate
in class TransactionalAccess
key
- 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 Region
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |