public abstract class InvalidationCacheAccessDelegate extends Object implements AccessDelegate
Modifier and Type | Field and Description |
---|---|
protected org.infinispan.AdvancedCache |
cache |
protected static org.infinispan.util.logging.Log |
log |
protected PutFromLoadValidator |
putValidator |
protected BaseRegion |
region |
protected static boolean |
TRACE_ENABLED |
protected org.infinispan.AdvancedCache<Object,Object> |
writeCache |
Modifier | Constructor and Description |
---|---|
protected |
InvalidationCacheAccessDelegate(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(SessionImplementor session,
Object key,
long txTimestamp)
Attempt to retrieve an object from the cache.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterInsert, afterUpdate, insert, update
protected static final org.infinispan.util.logging.Log log
protected static final boolean TRACE_ENABLED
protected final org.infinispan.AdvancedCache cache
protected final BaseRegion region
protected final PutFromLoadValidator putValidator
protected InvalidationCacheAccessDelegate(BaseRegion region, PutFromLoadValidator validator)
region
- to control access tovalidator
- put from load validatorpublic Object get(SessionImplementor session, Object key, long txTimestamp) throws CacheException
get
in interface AccessDelegate
session
- key
- The key of the item to be retrievedtxTimestamp
- a timestamp prior to the transaction start timeCacheException
- if the cache retrieval failedpublic 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
putFromLoad
in interface AccessDelegate
session
- Current sessionkey
- 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 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
Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.