com.hazelcast.hibernate.access
T
- implementation type of HazelcastRegionpublic abstract class AbstractAccessDelegate<T extends HazelcastRegion> extends Object implements AccessDelegate<T>
Modifier and Type | Field and Description |
---|---|
protected RegionCache |
cache |
protected T |
hazelcastRegion |
protected ILogger |
log |
protected Comparator<Object> |
versionComparator |
Modifier | Constructor and Description |
---|---|
protected |
AbstractAccessDelegate(T hazelcastRegion,
Properties props) |
Modifier and Type | Method and Description |
---|---|
void |
evict(Object key)
Forcibly evict an item from the cache immediately without regard for transaction
isolation.
|
void |
evictAll()
Forcibly evict all items from the cache immediately without regard for transaction
isolation.
|
Object |
get(Object key,
long txTimestamp)
Attempt to retrieve an object from the cache.
|
T |
getHazelcastRegion()
Get the wrapped cache region
|
boolean |
insert(Object key,
Object value,
Object version)
This is an asynchronous cache access strategy.
|
SoftLock |
lockRegion()
NO-OP
|
protected boolean |
put(Object key,
Object value,
Object currentVersion) |
boolean |
putFromLoad(Object key,
Object value,
long txTimestamp,
Object version)
Attempt to cache an object, after loading from the database.
|
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 |
unlockRegion(SoftLock lock)
NO-OP
|
boolean |
update(Object key,
Object value,
Object currentVersion,
Object previousVersion)
This is an asynchronous cache access strategy.
|
protected boolean |
update(Object key,
Object value,
Object currentVersion,
Object previousVersion,
SoftLock lock) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterInsert, afterUpdate, lockItem, putFromLoad, unlockItem
protected final ILogger log
protected final T extends HazelcastRegion hazelcastRegion
protected final RegionCache cache
protected final Comparator<Object> versionComparator
protected AbstractAccessDelegate(T hazelcastRegion, Properties props)
public final T getHazelcastRegion()
AccessDelegate
getHazelcastRegion
in interface AccessDelegate<T extends HazelcastRegion>
protected boolean update(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)
public Object get(Object key, long txTimestamp) throws org.hibernate.cache.CacheException
AccessDelegate
get
in interface AccessDelegate<T extends HazelcastRegion>
key
- The key of the item to be retrieved.txTimestamp
- a timestamp prior to the transaction start timeorg.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version) throws org.hibernate.cache.CacheException
AccessDelegate
putFromLoad
in interface AccessDelegate<T extends HazelcastRegion>
key
- The item keyvalue
- The itemtxTimestamp
- a timestamp prior to the transaction start timeversion
- the item version numberorg.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public void remove(Object key) throws org.hibernate.cache.CacheException
AccessDelegate
remove
in interface AccessDelegate<T extends HazelcastRegion>
key
- The key of the item to removeorg.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public void removeAll() throws org.hibernate.cache.CacheException
AccessDelegate
removeAll
in interface AccessDelegate<T extends HazelcastRegion>
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public void evict(Object key) throws org.hibernate.cache.CacheException
AccessDelegate
evict
in interface AccessDelegate<T extends HazelcastRegion>
key
- The key of the item to removeorg.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public void evictAll() throws org.hibernate.cache.CacheException
AccessDelegate
evictAll
in interface AccessDelegate<T extends HazelcastRegion>
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public SoftLock lockRegion() throws org.hibernate.cache.CacheException
lockRegion
in interface AccessDelegate<T extends HazelcastRegion>
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public void unlockRegion(SoftLock lock) throws org.hibernate.cache.CacheException
unlockRegion
in interface AccessDelegate<T extends HazelcastRegion>
lock
- The lock previously obtained from AccessDelegate.lockRegion()
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public boolean insert(Object key, Object value, Object version) throws org.hibernate.cache.CacheException
insert
in interface AccessDelegate<T extends HazelcastRegion>
key
- The item keyvalue
- The itemversion
- The item's version valueorg.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws org.hibernate.cache.CacheException
update
in interface AccessDelegate<T extends HazelcastRegion>
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valueorg.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.