org.hibernate.cache.jbc2.entity
Class ReadOnlyAccess
java.lang.Object
org.hibernate.cache.jbc2.entity.TransactionalAccess
org.hibernate.cache.jbc2.entity.ReadOnlyAccess
- All Implemented Interfaces:
- EntityRegionAccessStrategy
public class ReadOnlyAccess
- extends TransactionalAccess
This defines the strategy for transactional access to enity data in
JBossCache using its 2.x APIs
read-only access to a JBossCache really is
still transactional, just with the extra semantic or guarentee that we will
not update data.
- Author:
- Steve Ebersole
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReadOnlyAccess
public ReadOnlyAccess(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 © 2011 Hibernate.org. All Rights Reserved.