Class TxInvalidationCacheAccessDelegate
- java.lang.Object
-
- org.infinispan.hibernate.cache.commons.access.InvalidationCacheAccessDelegate
-
- org.infinispan.hibernate.cache.commons.access.TxInvalidationCacheAccessDelegate
-
- All Implemented Interfaces:
AccessDelegate
public class TxInvalidationCacheAccessDelegate extends InvalidationCacheAccessDelegate
Delegate for transactional caches- Author:
- Radim Vansa <rvansa@redhat.com>
-
-
Field Summary
-
Fields inherited from class org.infinispan.hibernate.cache.commons.access.InvalidationCacheAccessDelegate
cache, log, putValidator, region, trace, writeCache
-
-
Constructor Summary
Constructors Constructor Description TxInvalidationCacheAccessDelegate(InfinispanDataRegion region, PutFromLoadValidator validator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
afterInsert(Object session, Object key, Object value, Object version)
Called after an item has been inserted (after the transaction completes), instead of calling release().boolean
afterUpdate(Object session, Object key, Object value, Object currentVersion, Object previousVersion, org.hibernate.cache.spi.access.SoftLock lock)
Called after an item has been updated (after the transaction completes), instead of calling release().boolean
insert(Object session, Object key, Object value, Object version)
Called after an item has been inserted (before the transaction completes), instead of calling evict().boolean
update(Object session, Object key, Object value, Object currentVersion, Object previousVersion)
Called after an item has been updated (before the transaction completes), instead of calling evict().-
Methods inherited from class org.infinispan.hibernate.cache.commons.access.InvalidationCacheAccessDelegate
evict, evictAll, get, putFromLoad, putFromLoad, remove, removeAll, unlockItem
-
-
-
-
Constructor Detail
-
TxInvalidationCacheAccessDelegate
public TxInvalidationCacheAccessDelegate(InfinispanDataRegion region, PutFromLoadValidator validator)
-
-
Method Detail
-
insert
public boolean insert(Object session, Object key, Object value, Object version) throws org.hibernate.cache.CacheException
Description copied from interface:AccessDelegate
Called after an item has been inserted (before the transaction completes), instead of calling evict().- Parameters:
session
- Current sessionkey
- The item keyvalue
- The itemversion
- The item's version value- Returns:
- Were the contents of the cache actual changed by this operation?
- Throws:
org.hibernate.cache.CacheException
- if the insert fails
-
update
public boolean update(Object session, Object key, Object value, Object currentVersion, Object previousVersion) throws org.hibernate.cache.CacheException
Description copied from interface:AccessDelegate
Called after an item has been updated (before the transaction completes), instead of calling evict().- Parameters:
session
- Current sessionkey
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version value- Returns:
- Whether the contents of the cache actual changed by this operation
- Throws:
org.hibernate.cache.CacheException
- if the update fails
-
afterInsert
public boolean afterInsert(Object session, Object key, Object value, Object version)
Description copied from interface:AccessDelegate
Called after an item has been inserted (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.key
- The item keyvalue
- The itemversion
- The item's version value- Returns:
- Were the contents of the cache actual changed by this operation?
-
afterUpdate
public boolean afterUpdate(Object session, Object key, Object value, Object currentVersion, Object previousVersion, org.hibernate.cache.spi.access.SoftLock lock)
Description copied from interface:AccessDelegate
Called after an item has been updated (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valuelock
- The lock previously obtained from#lockItem
- Returns:
- Were the contents of the cache actual changed by this operation?
-
-