org.hibernate.cache.jbc2.entity
Class OptimisticReadOnlyAccess
java.lang.Object
org.hibernate.cache.jbc2.entity.TransactionalAccess
org.hibernate.cache.jbc2.entity.OptimisticTransactionalAccess
org.hibernate.cache.jbc2.entity.OptimisticReadOnlyAccess
- All Implemented Interfaces:
- EntityRegionAccessStrategy
public class OptimisticReadOnlyAccess
- extends OptimisticTransactionalAccess
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.
- Author:
- Brian Stansberry
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptimisticReadOnlyAccess
public OptimisticReadOnlyAccess(EntityRegionImpl region)
lockItem
public SoftLock lockItem(Object key,
Object version)
throws CacheException
- Specified by:
lockItem in interface EntityRegionAccessStrategy- Overrides:
lockItem in class TransactionalAccess
- Throws:
CacheException
lockRegion
public SoftLock lockRegion()
throws CacheException
- Specified by:
lockRegion in interface EntityRegionAccessStrategy- Overrides:
lockRegion in class TransactionalAccess
- Throws:
CacheException
unlockItem
public void unlockItem(Object key,
SoftLock lock)
throws CacheException
- Specified by:
unlockItem in interface EntityRegionAccessStrategy- Overrides:
unlockItem in class TransactionalAccess
- Throws:
CacheException
unlockRegion
public void unlockRegion(SoftLock lock)
throws CacheException
- Specified by:
unlockRegion in interface EntityRegionAccessStrategy- Overrides:
unlockRegion in class TransactionalAccess
- Throws:
CacheException
update
public boolean update(Object key,
Object value,
Object currentVersion,
Object previousVersion)
throws CacheException
- Specified by:
update in interface EntityRegionAccessStrategy- Overrides:
update in class TransactionalAccess
- Throws:
CacheException
afterUpdate
public boolean afterUpdate(Object key,
Object value,
Object currentVersion,
Object previousVersion,
SoftLock lock)
throws CacheException
- Specified by:
afterUpdate in interface EntityRegionAccessStrategy- Overrides:
afterUpdate in class TransactionalAccess
- Throws:
CacheException
Copyright © 2008 Hibernate.org. All Rights Reserved.