org.hibernate.cache.jbc2.collection
Class OptimisticReadOnlyAccess

java.lang.Object
  extended by org.hibernate.cache.jbc2.collection.TransactionalAccess
      extended by org.hibernate.cache.jbc2.collection.OptimisticTransactionalAccess
          extended by org.hibernate.cache.jbc2.collection.OptimisticReadOnlyAccess
All Implemented Interfaces:
CollectionRegionAccessStrategy

public class OptimisticReadOnlyAccess
extends OptimisticTransactionalAccess

This defines the strategy for transactional access to collection 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

Constructor Summary
OptimisticReadOnlyAccess(CollectionRegionImpl region)
          Create a new OptimisticReadOnlyAccess.
 
Method Summary
 SoftLock lockItem(Object key, Object version)
          
 SoftLock lockRegion()
          
 void unlockItem(Object key, SoftLock lock)
          
 void unlockRegion(SoftLock lock)
          
 
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

OptimisticReadOnlyAccess

public OptimisticReadOnlyAccess(CollectionRegionImpl region)
Create a new OptimisticReadOnlyAccess.

Parameters:
region - The region to which this is providing access
Method Detail

lockItem

public SoftLock lockItem(Object key,
                         Object version)
                  throws CacheException
Description copied from class: TransactionalAccess

Specified by:
lockItem in interface CollectionRegionAccessStrategy
Overrides:
lockItem in class TransactionalAccess
Throws:
CacheException

lockRegion

public SoftLock lockRegion()
                    throws CacheException
Description copied from class: TransactionalAccess

Specified by:
lockRegion in interface CollectionRegionAccessStrategy
Overrides:
lockRegion in class TransactionalAccess
Throws:
CacheException

unlockItem

public void unlockItem(Object key,
                       SoftLock lock)
                throws CacheException
Description copied from class: TransactionalAccess

Specified by:
unlockItem in interface CollectionRegionAccessStrategy
Overrides:
unlockItem in class TransactionalAccess
Throws:
CacheException

unlockRegion

public void unlockRegion(SoftLock lock)
                  throws CacheException
Description copied from class: TransactionalAccess

Specified by:
unlockRegion in interface CollectionRegionAccessStrategy
Overrides:
unlockRegion in class TransactionalAccess
Throws:
CacheException


Copyright © 2011 Hibernate.org. All Rights Reserved.