T
- implementation type of HazelcastRegionpublic class NonStrictReadWriteAccessDelegate<T extends HazelcastRegion> extends AbstractAccessDelegate<T>
cache, hazelcastRegion, log, versionComparator
Constructor and Description |
---|
NonStrictReadWriteAccessDelegate(T hazelcastRegion,
Properties props) |
Modifier and Type | Method and Description |
---|---|
boolean |
afterInsert(Object key,
Object value,
Object version)
Called after an item has been inserted (after the transaction completes),
instead of calling release().
|
boolean |
afterUpdate(Object key,
Object value,
Object currentVersion,
Object previousVersion,
SoftLock lock)
Called after an item has been updated (after the transaction completes),
instead of calling release().
|
boolean |
insert(Object key,
Object value,
Object version)
Called after an item has been inserted (before the transaction completes),
instead of calling evict().
|
SoftLock |
lockItem(Object key,
Object version)
We are going to attempt to update/delete the keyed object.
|
void |
remove(Object key)
Called after an item has become stale (before the transaction completes).
|
void |
removeAll()
Called to evict data from the entire region
|
void |
unlockItem(Object key,
SoftLock lock)
Called when we have finished the attempted update/delete (which may or
may not have been successful), after transaction completion.
|
boolean |
update(Object key,
Object value,
Object currentVersion,
Object previousVersion)
Called after an item has been updated (before the transaction completes),
instead of calling evict().
|
evict, evictAll, get, getHazelcastRegion, lockRegion, putFromLoad, putFromLoad, unlockRegion
public NonStrictReadWriteAccessDelegate(T hazelcastRegion, Properties props)
public boolean afterInsert(Object key, Object value, Object version) throws org.hibernate.cache.CacheException
false
since this is a non-strict read/write cache access strategykey
- The item keyvalue
- The itemversion
- The item's version valueorg.hibernate.cache.CacheException
- Propagated from underlying org.hibernate.cache.Region
public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws org.hibernate.cache.CacheException
AccessDelegate
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valuelock
- The lock previously obtained from AccessDelegate.lockItem(java.lang.Object, java.lang.Object)
org.hibernate.cache.CacheException
- Propagated from underlying org.hibernate.cache.Region
public boolean insert(Object key, Object value, Object version) throws org.hibernate.cache.CacheException
false
since this is an asynchronous cache access strategy.key
- The item keyvalue
- The itemversion
- The item's version valueorg.hibernate.cache.CacheException
- Propagated from underlying org.hibernate.cache.Region
public boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valuepublic void remove(Object key) throws org.hibernate.cache.CacheException
AccessDelegate
key
- The key of the item to removeorg.hibernate.cache.CacheException
- Propagated from underlying org.hibernate.cache.Region
public SoftLock lockItem(Object key, Object version) throws org.hibernate.cache.CacheException
AccessDelegate
key
- The key of the item to lockversion
- The item's current version valueorg.hibernate.cache.CacheException
- Propagated from underlying org.hibernate.cache.Region
public void removeAll() throws org.hibernate.cache.CacheException
AccessDelegate
org.hibernate.cache.CacheException
- Propagated from underlying org.hibernate.cache.Region
public void unlockItem(Object key, SoftLock lock) throws org.hibernate.cache.CacheException
AccessDelegate
key
- The item keylock
- The lock previously obtained from AccessDelegate.lockItem(java.lang.Object, java.lang.Object)
org.hibernate.cache.CacheException
- Propagated from underlying org.hibernate.cache.Region
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.