Interface AccessDelegate
- All Known Implementing Classes:
InvalidationCacheAccessDelegate,NonStrictAccessDelegate,NonTxInvalidationCacheAccessDelegate,TombstoneAccessDelegate,TxInvalidationCacheAccessDelegate
public interface AccessDelegate
Defines the strategy for access to entity or collection data in a Infinispan instance.
The intent of this class is to encapsulate common code and serve as a delegate for
and
implementations.
invalid reference
org.hibernate.cache.spi.access.EntityRegionAccessStrategy
invalid reference
org.hibernate.cache.spi.access.CollectionRegionAccessStrategy
- Author:
- Radim Vansa <rvansa@redhat.com>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanafterInsert(Object session, Object key, Object value, Object version) Called after an item has been inserted (after the transaction completes), instead of calling release().booleanafterUpdate(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().voidForcibly evict an item from the cache immediately without regard for transaction isolation.voidevictAll()Forcibly evict all items from the cache immediately without regard for transaction isolation.booleanCalled after an item has been inserted (before the transaction completes), instead of calling evict().voidlockAll()Called just before the delegate will have all entries removed.booleanputFromLoad(Object session, Object key, Object value, long txTimestamp, Object version) Attempt to cache an object, after loading from the database.booleanputFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) Attempt to cache an object, after loading from the database, explicitly specifying the minimalPut behavior.voidCalled after an item has become stale (before the transaction completes).voidCalled to evict data from the entire regionvoidCalled just after the delegate had all entries removed viaremoveAll().voidunlockItem(Object session, Object key) Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion.booleanCalled after an item has been updated (before the transaction completes), instead of calling evict().
-
Method Details
-
get
- Throws:
org.hibernate.cache.CacheException
-
putFromLoad
Attempt to cache an object, after loading from the database.- Parameters:
session- Current sessionkey- The item keyvalue- The itemtxTimestamp- a timestamp prior to the transaction start timeversion- the item version number- Returns:
- true if the object was successfully cached
-
putFromLoad
boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws org.hibernate.cache.CacheException Attempt to cache an object, after loading from the database, explicitly specifying the minimalPut behavior.- Parameters:
session- Current session.key- The item keyvalue- The itemtxTimestamp- a timestamp prior to the transaction start timeversion- the item version numberminimalPutOverride- Explicit minimalPut flag- Returns:
- true if the object was successfully cached
- Throws:
org.hibernate.cache.CacheException- Propogated from underlyingRegion
-
insert
boolean insert(Object session, Object key, Object value, Object version) throws org.hibernate.cache.CacheException 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
boolean update(Object session, Object key, Object value, Object currentVersion, Object previousVersion) throws org.hibernate.cache.CacheException 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
-
remove
Called after an item has become stale (before the transaction completes).- Parameters:
session- Current sessionkey- The key of the item to remove- Throws:
org.hibernate.cache.CacheException- if removing the cached item fails
-
lockAll
void lockAll() throws org.hibernate.cache.CacheExceptionCalled just before the delegate will have all entries removed. Any work to prevent concurrent modifications while this occurs should happen here- Throws:
org.hibernate.cache.CacheException- if locking had an issue
-
unlockAll
void unlockAll() throws org.hibernate.cache.CacheExceptionCalled just after the delegate had all entries removed viaremoveAll(). Any work required to allow for new modifications to happen should be done here- Throws:
org.hibernate.cache.CacheException- if unlocking had an issue
-
removeAll
void removeAll() throws org.hibernate.cache.CacheExceptionCalled to evict data from the entire region- Throws:
org.hibernate.cache.CacheException- if eviction the region fails
-
evict
Forcibly evict an item from the cache immediately without regard for transaction isolation.- Parameters:
key- The key of the item to remove- Throws:
org.hibernate.cache.CacheException- if evicting the item fails
-
evictAll
void evictAll() throws org.hibernate.cache.CacheExceptionForcibly evict all items from the cache immediately without regard for transaction isolation.- Throws:
org.hibernate.cache.CacheException- if evicting items fails
-
unlockItem
Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion. This method is used by "asynchronous" concurrency strategies.- Parameters:
session-key- The item key- Throws:
org.hibernate.cache.CacheException- Propogated from underlyingRegion
-
afterInsert
Called after an item has been inserted (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.- Parameters:
session-key- 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- Propagated from underlyingRegion
-
afterUpdate
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(). This method is used by "asynchronous" concurrency strategies.- Parameters:
session-key- The item keyvalue- The itemcurrentVersion- The item's current version valuepreviousVersion- The item's previous version valuelock- The lock previously obtained frominvalid reference
#lockItem- Returns:
- Were the contents of the cache actual changed by this operation?
- Throws:
org.hibernate.cache.CacheException- Propagated from underlyingRegion
-