public class NonStrictAccessDelegate extends Object implements AccessDelegate
Constructor and Description |
---|
NonStrictAccessDelegate(BaseTransactionalDataRegion region) |
Modifier and Type | Method and Description |
---|---|
boolean |
afterInsert(SessionImplementor session,
Object key,
Object value,
Object version)
Called after an item has been inserted (after the transaction completes),
instead of calling release().
|
boolean |
afterUpdate(SessionImplementor session,
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().
|
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(SessionImplementor session,
Object key,
long txTimestamp) |
protected Object |
getVersion(Object value) |
protected Object |
getVersioned(Object value,
Object version,
long timestamp) |
boolean |
insert(SessionImplementor session,
Object key,
Object value,
Object version)
Called after an item has been inserted (before the transaction completes),
instead of calling evict().
|
boolean |
putFromLoad(SessionImplementor session,
Object key,
Object value,
long txTimestamp,
Object version)
Attempt to cache an object, after loading from the database.
|
boolean |
putFromLoad(SessionImplementor 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.
|
void |
remove(SessionImplementor session,
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(SessionImplementor session,
Object key)
Called when we have finished the attempted update/delete (which may or
may not have been successful), after transaction completion.
|
boolean |
update(SessionImplementor session,
Object key,
Object value,
Object currentVersion,
Object previousVersion)
Called after an item has been updated (before the transaction completes),
instead of calling evict().
|
public NonStrictAccessDelegate(BaseTransactionalDataRegion region)
public Object get(SessionImplementor session, Object key, long txTimestamp) throws CacheException
get
in interface AccessDelegate
CacheException
public boolean putFromLoad(SessionImplementor session, Object key, Object value, long txTimestamp, Object version)
AccessDelegate
putFromLoad
in interface AccessDelegate
session
- Current sessionkey
- The item keyvalue
- The itemtxTimestamp
- a timestamp prior to the transaction start timeversion
- the item version numberpublic boolean putFromLoad(SessionImplementor session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException
AccessDelegate
putFromLoad
in interface AccessDelegate
session
- Current session.key
- The item keyvalue
- The itemtxTimestamp
- a timestamp prior to the transaction start timeversion
- the item version numberminimalPutOverride
- Explicit minimalPut flagCacheException
- Propogated from underlying Region
public boolean insert(SessionImplementor session, Object key, Object value, Object version) throws CacheException
AccessDelegate
insert
in interface AccessDelegate
session
- Current sessionkey
- The item keyvalue
- The itemversion
- The item's version valueCacheException
- if the insert failspublic boolean update(SessionImplementor session, Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException
AccessDelegate
update
in interface AccessDelegate
session
- Current sessionkey
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valueCacheException
- if the update failspublic void remove(SessionImplementor session, Object key) throws CacheException
AccessDelegate
remove
in interface AccessDelegate
session
- Current sessionkey
- The key of the item to removeCacheException
- if removing the cached item failspublic void removeAll() throws CacheException
AccessDelegate
removeAll
in interface AccessDelegate
CacheException
- if eviction the region failspublic void evict(Object key) throws CacheException
AccessDelegate
evict
in interface AccessDelegate
key
- The key of the item to removeCacheException
- if evicting the item failspublic void evictAll() throws CacheException
AccessDelegate
evictAll
in interface AccessDelegate
CacheException
- if evicting items failspublic void unlockItem(SessionImplementor session, Object key) throws CacheException
AccessDelegate
unlockItem
in interface AccessDelegate
key
- The item keyCacheException
- Propogated from underlying Region
public boolean afterInsert(SessionImplementor session, Object key, Object value, Object version)
AccessDelegate
afterInsert
in interface AccessDelegate
key
- The item keyvalue
- The itemversion
- The item's version valuepublic boolean afterUpdate(SessionImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)
AccessDelegate
afterUpdate
in interface AccessDelegate
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valuelock
- The lock previously obtained from #lockItem
Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.