public abstract class BaseRegionAccessStrategy extends java.lang.Object implements RegionAccessStrategy
Constructor and Description |
---|
BaseRegionAccessStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
evict(java.lang.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.
|
java.lang.Object |
get(SharedSessionContractImplementor session,
java.lang.Object key,
long txTimestamp)
Attempt to retrieve an object from the cache.
|
protected abstract org.hibernate.testing.cache.BaseGeneralDataRegion |
getInternalRegion() |
protected abstract boolean |
isDefaultMinimalPutOverride() |
SoftLock |
lockItem(SharedSessionContractImplementor session,
java.lang.Object key,
java.lang.Object version)
We are going to attempt to update/delete the keyed object.
|
SoftLock |
lockRegion()
Region locks are not supported.
|
boolean |
putFromLoad(SharedSessionContractImplementor session,
java.lang.Object key,
java.lang.Object value,
long txTimestamp,
java.lang.Object version)
Attempt to cache an object, after loading from the database.
|
boolean |
putFromLoad(SharedSessionContractImplementor session,
java.lang.Object key,
java.lang.Object value,
long txTimestamp,
java.lang.Object version,
boolean minimalPutOverride)
Attempt to cache an object, after loading from the database, explicitly
specifying the minimalPut behavior.
|
void |
remove(SharedSessionContractImplementor session,
java.lang.Object key)
A no-op since this is an asynchronous cache access strategy.
|
void |
removeAll()
Called to evict data from the entire region
|
void |
unlockItem(SharedSessionContractImplementor session,
java.lang.Object key,
SoftLock lock)
Called when we have finished the attempted update/delete (which may or
may not have been successful), after transaction completion.
|
void |
unlockRegion(SoftLock lock)
Region locks are not supported - perform a cache clear as a precaution.
|
protected abstract org.hibernate.testing.cache.BaseGeneralDataRegion getInternalRegion()
protected abstract boolean isDefaultMinimalPutOverride()
public java.lang.Object get(SharedSessionContractImplementor session, java.lang.Object key, long txTimestamp) throws CacheException
RegionAccessStrategy
get
in interface RegionAccessStrategy
session
- Current session.key
- The key of the item to be retrieved.txTimestamp
- a timestamp prior to the transaction start timeCacheException
- Propogated from underlying Region
public boolean putFromLoad(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value, long txTimestamp, java.lang.Object version) throws CacheException
RegionAccessStrategy
putFromLoad
in interface RegionAccessStrategy
session
- Current session.key
- The item keyvalue
- The itemtxTimestamp
- a timestamp prior to the transaction start timeversion
- the item version numberCacheException
- Propogated from underlying Region
public boolean putFromLoad(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value, long txTimestamp, java.lang.Object version, boolean minimalPutOverride) throws CacheException
RegionAccessStrategy
putFromLoad
in interface RegionAccessStrategy
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 SoftLock lockRegion() throws CacheException
lockRegion
in interface RegionAccessStrategy
null
CacheException
- Propogated from underlying Region
RegionAccessStrategy.lockRegion()
,
RegionAccessStrategy.lockRegion()
public void unlockRegion(SoftLock lock) throws CacheException
unlockRegion
in interface RegionAccessStrategy
lock
- The lock previously obtained from RegionAccessStrategy.lockRegion()
CacheException
- Propogated from underlying Region
RegionAccessStrategy.unlockRegion(org.hibernate.cache.spi.access.SoftLock)
,
RegionAccessStrategy.unlockRegion(org.hibernate.cache.spi.access.SoftLock)
public SoftLock lockItem(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object version) throws CacheException
RegionAccessStrategy
RegionAccessStrategy.unlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, org.hibernate.cache.spi.access.SoftLock)
, to release the
lock. Concurrency strategies which do not support client-visible
locks may silently return null.lockItem
in interface RegionAccessStrategy
session
- Current session.key
- The key of the item to lockversion
- The item's current version valueCacheException
- Propogated from underlying Region
public void unlockItem(SharedSessionContractImplementor session, java.lang.Object key, SoftLock lock) throws CacheException
RegionAccessStrategy
unlockItem
in interface RegionAccessStrategy
session
- Current session.key
- The item keylock
- The lock previously obtained from RegionAccessStrategy.lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object, java.lang.Object)
CacheException
- Propogated from underlying Region
public void remove(SharedSessionContractImplementor session, java.lang.Object key) throws CacheException
remove
in interface RegionAccessStrategy
key
- The key of the item to removeCacheException
- Propogated from underlying Region
RegionAccessStrategy.remove(SharedSessionContractImplementor, Object)
public void removeAll() throws CacheException
removeAll
in interface RegionAccessStrategy
CacheException
- Propogated from underlying Region
RegionAccessStrategy.removeAll()
,
RegionAccessStrategy.removeAll()
public void evict(java.lang.Object key) throws CacheException
RegionAccessStrategy
evict
in interface RegionAccessStrategy
key
- The key of the item to removeCacheException
- Propogated from underlying Region
public void evictAll() throws CacheException
RegionAccessStrategy
evictAll
in interface RegionAccessStrategy
CacheException
- Propogated from underlying Region
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.