|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.cache.jbc2.collection.TransactionalAccess org.hibernate.cache.jbc2.collection.ReadOnlyAccess
public class ReadOnlyAccess
This defines the strategy for transactional access to collection data in a pessimistic-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.
Constructor Summary | |
---|---|
ReadOnlyAccess(CollectionRegionImpl region)
Create a provider of read-only access to the specific region. |
Method Summary | |
---|---|
SoftLock |
lockItem(Object key,
Object version)
We are going to attempt to update/delete the keyed object. This method is used by "asynchronous" concurrency strategies. The returned object must be passed back to release(), to release the lock. Concurrency strategies which do not support client-visible locks may silently return null. |
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. This method is used by "asynchronous" concurrency strategies. |
void |
unlockRegion(SoftLock lock)
Called after we have finished the attempted invalidation of the entire region |
Methods inherited from class org.hibernate.cache.jbc2.collection.TransactionalAccess |
---|
evict, evictAll, get, getRegion, 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 ReadOnlyAccess(CollectionRegionImpl region)
region
- The region to which this provides access.Method Detail |
---|
public SoftLock lockItem(Object key, Object version) throws CacheException
lockItem
in interface CollectionRegionAccessStrategy
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
lockRegion
in interface CollectionRegionAccessStrategy
lockRegion
in class TransactionalAccess
CacheException
- Propogated from underlying Region
public void unlockItem(Object key, SoftLock lock) throws CacheException
unlockItem
in interface CollectionRegionAccessStrategy
unlockItem
in class TransactionalAccess
key
- The item keylock
- The lock previously obtained from CollectionRegionAccessStrategy.lockItem(java.lang.Object, java.lang.Object)
CacheException
- Propogated from underlying Region
public void unlockRegion(SoftLock lock) throws CacheException
unlockRegion
in interface CollectionRegionAccessStrategy
unlockRegion
in class TransactionalAccess
lock
- The lock previously obtained from CollectionRegionAccessStrategy.lockRegion()
CacheException
- Propogated from underlying Region
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |