org.hibernate.cache.jbc2.collection
Class TransactionalAccess

java.lang.Object
  extended by org.hibernate.cache.jbc2.collection.TransactionalAccess
All Implemented Interfaces:
CollectionRegionAccessStrategy
Direct Known Subclasses:
OptimisticTransactionalAccess, ReadOnlyAccess

public class TransactionalAccess
extends Object
implements CollectionRegionAccessStrategy

This defines the strategy for transactional access to collection data in a pessimistic-locking JBossCache using its 2.x APIs

Author:
Steve Ebersole, Brian Stansberry

Constructor Summary
  TransactionalAccess(CollectionRegionImpl region)
          Create a new TransactionalAccess.
protected TransactionalAccess(CollectionRegionImpl region, TransactionalAccessDelegate delegate)
          Allow subclasses to define the delegate.
 
Method Summary
 void evict(Object key)
          
 void evictAll()
          
 Object get(Object key, long txTimestamp)
          
 CollectionRegion getRegion()
          
 SoftLock lockItem(Object key, Object version)
          
 SoftLock lockRegion()
          
 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()
          
 void unlockItem(Object key, SoftLock lock)
          
 void unlockRegion(SoftLock lock)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionalAccess

public TransactionalAccess(CollectionRegionImpl region)
Create a new TransactionalAccess.

Parameters:
region - the region to which this provides access

TransactionalAccess

protected TransactionalAccess(CollectionRegionImpl region,
                              TransactionalAccessDelegate delegate)
Allow subclasses to define the delegate.

Parameters:
region - the region to which this provides access
delegate - type of transactional access
Method Detail

getRegion

public CollectionRegion getRegion()

Specified by:
getRegion in interface CollectionRegionAccessStrategy

get

public Object get(Object key,
                  long txTimestamp)
           throws CacheException

Specified by:
get in interface CollectionRegionAccessStrategy
Throws:
CacheException

putFromLoad

public boolean putFromLoad(Object key,
                           Object value,
                           long txTimestamp,
                           Object version)
                    throws CacheException

Specified by:
putFromLoad in interface CollectionRegionAccessStrategy
Throws:
CacheException

putFromLoad

public boolean putFromLoad(Object key,
                           Object value,
                           long txTimestamp,
                           Object version,
                           boolean minimalPutOverride)
                    throws CacheException

Specified by:
putFromLoad in interface CollectionRegionAccessStrategy
Throws:
CacheException

remove

public void remove(Object key)
            throws CacheException

Specified by:
remove in interface CollectionRegionAccessStrategy
Throws:
CacheException

removeAll

public void removeAll()
               throws CacheException

Specified by:
removeAll in interface CollectionRegionAccessStrategy
Throws:
CacheException

evict

public void evict(Object key)
           throws CacheException

Specified by:
evict in interface CollectionRegionAccessStrategy
Throws:
CacheException

evictAll

public void evictAll()
              throws CacheException

Specified by:
evictAll in interface CollectionRegionAccessStrategy
Throws:
CacheException

lockItem

public SoftLock lockItem(Object key,
                         Object version)
                  throws CacheException

Specified by:
lockItem in interface CollectionRegionAccessStrategy
Throws:
CacheException

lockRegion

public SoftLock lockRegion()
                    throws CacheException

Specified by:
lockRegion in interface CollectionRegionAccessStrategy
Throws:
CacheException

unlockItem

public void unlockItem(Object key,
                       SoftLock lock)
                throws CacheException

Specified by:
unlockItem in interface CollectionRegionAccessStrategy
Throws:
CacheException

unlockRegion

public void unlockRegion(SoftLock lock)
                  throws CacheException

Specified by:
unlockRegion in interface CollectionRegionAccessStrategy
Throws:
CacheException


Copyright © 2011 Hibernate.org. All Rights Reserved.