public class TransactionalAccessDelegate extends Object
EntityRegionAccessStrategy
and CollectionRegionAccessStrategy
implementations.Constructor and Description |
---|
TransactionalAccessDelegate(BaseRegion region,
PutFromLoadValidator validator)
Create a new transactional access delegate instance.
|
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.
|
boolean |
insert(Object key,
Object value,
Object version)
Called after an item has been inserted (before the transaction completes),
instead of calling evict().
|
boolean |
putFromLoad(Object key,
Object value,
long txTimestamp,
Object version)
Attempt to cache an object, after loading from the database.
|
boolean |
putFromLoad(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(Object key)
Called after an item has become stale (before the transaction completes).
|
void |
removeAll()
Called to evict data from the entire region
|
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().
|
public TransactionalAccessDelegate(BaseRegion region, PutFromLoadValidator validator)
region
- to control access tovalidator
- put from load validatorpublic Object get(Object key, long txTimestamp) throws CacheException
key
- The key of the item to be retrievedtxTimestamp
- a timestamp prior to the transaction start timeCacheException
- if the cache retrieval failedpublic boolean putFromLoad(Object key, Object value, long txTimestamp, Object version)
key
- The item keyvalue
- The itemtxTimestamp
- a timestamp prior to the transaction start timeversion
- the item version numberpublic boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException
key
- The item keyvalue
- The itemtxTimestamp
- a timestamp prior to the transaction start timeversion
- the item version numberminimalPutOverride
- Explicit minimalPut flagCacheException
- if storing the object failedpublic boolean insert(Object key, Object value, Object version) throws CacheException
key
- The item keyvalue
- The itemversion
- The item's version valueCacheException
- if the insert failspublic boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valueCacheException
- if the update failspublic void remove(Object key) throws CacheException
key
- The key of the item to removeCacheException
- if removing the cached item failspublic void removeAll() throws CacheException
CacheException
- if eviction the region failspublic void evict(Object key) throws CacheException
key
- The key of the item to removeCacheException
- if evicting the item failspublic void evictAll() throws CacheException
CacheException
- if evicting items failsCopyright © 2001-2015 Red Hat, Inc. All Rights Reserved.