org.hibernate.cache.jbc2.access
Class OptimisticTransactionalAccessDelegate

java.lang.Object
  extended by org.hibernate.cache.jbc2.access.TransactionalAccessDelegate
      extended by org.hibernate.cache.jbc2.access.OptimisticTransactionalAccessDelegate

public class OptimisticTransactionalAccessDelegate
extends TransactionalAccessDelegate

Defines the strategy for transactional access to entity or collection data in an optimistic-locking JBoss Cache using its 2.x APIs.

The intent of this class is to encapsulate common code and serve as a delegate for EntityRegionAccessStrategy and CollectionRegionAccessStrategy implementations.

Version:
$Revision: 1 $
Author:
Brian Stansberry

Field Summary
protected  CacheDataDescription dataDescription
           
 
Fields inherited from class org.hibernate.cache.jbc2.access.TransactionalAccessDelegate
cache, region, regionFqn
 
Constructor Summary
OptimisticTransactionalAccessDelegate(TransactionalDataRegionAdapter region)
           
 
Method Summary
 void evict(Object key)
          Overrides the superclass by adding a NonLockingDataVersion to the invocation.
 void evictAll()
          Overrides the superclass by adding a NonLockingDataVersion to the invocation.
 Object get(Object key, long txTimestamp)
          Overrides the superclass by ensuring the root node for the region exists before making the call.
 boolean insert(Object key, Object value, Object version)
          Overrides the superclass by adding a DataVersion to the invocation.
 boolean putFromLoad(Object key, Object value, long txTimestamp, Object version)
           
 boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
           
 void remove(Object key)
           
 void removeAll()
           
 boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
           
 
Methods inherited from class org.hibernate.cache.jbc2.access.TransactionalAccessDelegate
afterInsert, afterUpdate, lockItem, lockRegion, unlockItem, unlockRegion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataDescription

protected final CacheDataDescription dataDescription
Constructor Detail

OptimisticTransactionalAccessDelegate

public OptimisticTransactionalAccessDelegate(TransactionalDataRegionAdapter region)
Method Detail

evict

public void evict(Object key)
           throws CacheException
Overrides the superclass by adding a NonLockingDataVersion to the invocation.

Overrides:
evict in class TransactionalAccessDelegate
Throws:
CacheException

evictAll

public void evictAll()
              throws CacheException
Overrides the superclass by adding a NonLockingDataVersion to the invocation.

Overrides:
evictAll in class TransactionalAccessDelegate
Throws:
CacheException

get

public Object get(Object key,
                  long txTimestamp)
           throws CacheException
Overrides the superclass by ensuring the root node for the region exists before making the call.

Overrides:
get in class TransactionalAccessDelegate
Throws:
CacheException

insert

public boolean insert(Object key,
                      Object value,
                      Object version)
               throws CacheException
Overrides the superclass by adding a DataVersion to the invocation.

Overrides:
insert in class TransactionalAccessDelegate
Throws:
CacheException

putFromLoad

public boolean putFromLoad(Object key,
                           Object value,
                           long txTimestamp,
                           Object version,
                           boolean minimalPutOverride)
                    throws CacheException
Overrides:
putFromLoad in class TransactionalAccessDelegate
Throws:
CacheException

putFromLoad

public boolean putFromLoad(Object key,
                           Object value,
                           long txTimestamp,
                           Object version)
                    throws CacheException
Overrides:
putFromLoad in class TransactionalAccessDelegate
Throws:
CacheException

remove

public void remove(Object key)
            throws CacheException
Overrides:
remove in class TransactionalAccessDelegate
Throws:
CacheException

removeAll

public void removeAll()
               throws CacheException
Overrides:
removeAll in class TransactionalAccessDelegate
Throws:
CacheException

update

public boolean update(Object key,
                      Object value,
                      Object currentVersion,
                      Object previousVersion)
               throws CacheException
Overrides:
update in class TransactionalAccessDelegate
Throws:
CacheException


Copyright © null-null Red Hat Middleware, LLC. All Rights Reserved