org.hibernate.cache.jbc2.entity
Class ReadOnlyAccess

java.lang.Object
  extended by org.hibernate.cache.jbc2.entity.TransactionalAccess
      extended by 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

Field Summary
 
Fields inherited from class org.hibernate.cache.jbc2.entity.TransactionalAccess
region
 
Constructor Summary
ReadOnlyAccess(EntityRegionImpl region)
           
 
Method Summary
 boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)
           
 SoftLock lockItem(Object key, Object version)
           
 SoftLock lockRegion()
           
 void unlockItem(Object key, SoftLock lock)
           
 void unlockRegion(SoftLock lock)
           
 boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
           
 
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

ReadOnlyAccess

public ReadOnlyAccess(EntityRegionImpl region)
Method Detail

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.