public abstract class AbstractCachedDomainDataAccess extends Object implements CachedDomainDataAccess, AbstractDomainDataRegion.Destructible
Modifier | Constructor and Description |
---|---|
protected |
AbstractCachedDomainDataAccess(DomainDataRegion region,
DomainDataStorageAccess storageAccess) |
Modifier and Type | Method and Description |
---|---|
protected void |
clearCache() |
boolean |
contains(Object key)
Determine whether this region contains data for the given key.
|
void |
destroy() |
void |
evict(Object key)
Forcibly evict an item from the cache immediately without regard for transaction
isolation and/or locking.
|
void |
evictAll()
Forcibly evict all items from the cache immediately without regard for transaction
isolation.
|
Object |
get(SharedSessionContractImplementor session,
Object key)
Attempt to retrieve an object from the cache.
|
DomainDataRegion |
getRegion()
The region containing the data being accessed
|
protected DomainDataStorageAccess |
getStorageAccess() |
SoftLock |
lockRegion()
Lock the entire region
|
boolean |
putFromLoad(SharedSessionContractImplementor session,
Object key,
Object value,
Object version)
Attempt to cache an object, afterQuery loading from the database.
|
boolean |
putFromLoad(SharedSessionContractImplementor session,
Object key,
Object value,
Object version,
boolean minimalPutOverride)
Attempt to cache an object, afterQuery loading from the database, explicitly
specifying the minimalPut behavior.
|
void |
remove(SharedSessionContractImplementor session,
Object key)
Called afterQuery an item has become stale (beforeQuery the transaction completes).
|
void |
removeAll(SharedSessionContractImplementor session)
Remove all data for this accessed type
|
void |
unlockRegion(SoftLock lock)
Called after we have finished the attempted invalidation of the entire
region
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAccessType, lockItem, unlockItem
protected AbstractCachedDomainDataAccess(DomainDataRegion region, DomainDataStorageAccess storageAccess)
public DomainDataRegion getRegion()
CachedDomainDataAccess
getRegion
in interface CachedDomainDataAccess
protected DomainDataStorageAccess getStorageAccess()
protected void clearCache()
public boolean contains(Object key)
CachedDomainDataAccess
contains
in interface CachedDomainDataAccess
key
- The cache keypublic Object get(SharedSessionContractImplementor session, Object key)
CachedDomainDataAccess
get
in interface CachedDomainDataAccess
session
- Current session.key
- The key of the item to be retrieved.null
public boolean putFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version)
CachedDomainDataAccess
putFromLoad
in interface CachedDomainDataAccess
session
- Current session.key
- The item keyvalue
- The itemversion
- the item version numbertrue
if the object was successfully cachedpublic boolean putFromLoad(SharedSessionContractImplementor session, Object key, Object value, Object version, boolean minimalPutOverride)
CachedDomainDataAccess
putFromLoad
in interface CachedDomainDataAccess
session
- Current session.key
- The item keyvalue
- The itemversion
- the item version numberminimalPutOverride
- Explicit minimalPut flagtrue
if the object was successfully cachedpublic SoftLock lockRegion()
CachedDomainDataAccess
lockRegion
in interface CachedDomainDataAccess
null
.public void unlockRegion(SoftLock lock)
CachedDomainDataAccess
unlockRegion
in interface CachedDomainDataAccess
lock
- The lock previously obtained from CachedDomainDataAccess.lockRegion()
public void remove(SharedSessionContractImplementor session, Object key)
CachedDomainDataAccess
remove
in interface CachedDomainDataAccess
session
- Current session.key
- The key of the item to removepublic void removeAll(SharedSessionContractImplementor session)
CachedDomainDataAccess
removeAll
in interface CachedDomainDataAccess
public void evict(Object key)
CachedDomainDataAccess
Cache.evict(Class, Object)
, as well as the
Hibernate extension Cache.evictEntityData(Class, Serializable)
and Cache.evictEntityData(String, Serializable)
evict
in interface CachedDomainDataAccess
key
- The key of the item to removepublic void evictAll()
CachedDomainDataAccess
Cache.evictAll()
as well as the Hibernate
extensions Cache.evictEntityData(Class)
,
Cache.evictEntityData(String)
and
Cache.evictEntityData()
evictAll
in interface CachedDomainDataAccess
public void destroy()
destroy
in interface AbstractDomainDataRegion.Destructible
Copyright © 2021 JBoss by Red Hat. All rights reserved.