Class CoherenceReadOnlyEntityAccess
- java.lang.Object
-
- com.oracle.coherence.hibernate.cache.v53.access.CoherenceReadOnlyEntityAccess
-
- All Implemented Interfaces:
org.hibernate.cache.spi.access.CachedDomainDataAccess,org.hibernate.cache.spi.access.EntityDataAccess
public class CoherenceReadOnlyEntityAccess extends Object implements org.hibernate.cache.spi.access.EntityDataAccess
An CoherenceReadOnlyEntityAccess is an AbstractCoherenceEntityDataAccess implementing Hibernate's read-only cache concurrency strategy for entity regions.- Author:
- Randy Stafford, Gunnar Hillert
-
-
Field Summary
Fields Modifier and Type Field Description static StringTRANSACTIONAL_STRATEGY_NOT_SUPPORTED_MESSAGEThe log message indicating lack of support for the transactional cache concurrency strategy.protected static StringWRITE_OPERATIONS_NOT_SUPPORTED_MESSAGEA message indicating write operations are not supported in the read-only cache concurrency strategy.
-
Constructor Summary
Constructors Constructor Description CoherenceReadOnlyEntityAccess(org.hibernate.cache.spi.DomainDataRegion domainDataRegion, org.hibernate.cache.spi.support.DomainDataStorageAccess domainDataStorageAccess, Comparator<?> versionComparator)Complete constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanafterInsert(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version)booleanafterUpdate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, org.hibernate.cache.spi.access.SoftLock lock)booleancontains(Object key)voidevict(Object key)voidevictAll()ObjectgenerateCacheKey(Object id, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactoryImplementor, String tenantIdentifier)Objectget(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key)org.hibernate.cache.spi.access.AccessTypegetAccessType()ObjectgetCacheKeyId(Object cacheKey)protected org.hibernate.cache.spi.CacheKeysFactorygetCacheKeysFactory()protected CoherenceRegiongetCoherenceRegion()Returns the CoherenceRegion for which this is a AbstractCoherenceEntityDataAccess.org.hibernate.cache.spi.DomainDataRegiongetRegion()protected org.hibernate.cache.spi.support.DomainDataStorageAccessgetStorageAccess()protected UUIDgetUuid()Returns the UUID of this AbstractCoherenceEntityDataAccess.Comparator<?>getVersionComparator()booleaninsert(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version)org.hibernate.cache.spi.access.SoftLocklockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object version)org.hibernate.cache.spi.access.SoftLocklockRegion()protected CoherenceRegionValuenewCacheValue(Object value, Object version)Returns a new cache value with the argument value and version.protected longnextSoftLockSequenceNumber()Returns the next sequence number for a SoftLock acquired by this AbstractCoherenceEntityDataAccess.booleanputFromLoad(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version)booleanputFromLoad(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version, boolean minimalPutOverride)voidremove(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key)voidremoveAll(org.hibernate.engine.spi.SharedSessionContractImplementor session)StringtoString()}voidunlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, org.hibernate.cache.spi.access.SoftLock lock)voidunlockRegion(org.hibernate.cache.spi.access.SoftLock lock)booleanupdate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion)
-
-
-
Field Detail
-
TRANSACTIONAL_STRATEGY_NOT_SUPPORTED_MESSAGE
public static final String TRANSACTIONAL_STRATEGY_NOT_SUPPORTED_MESSAGE
The log message indicating lack of support for the transactional cache concurrency strategy.- See Also:
- Constant Field Values
-
WRITE_OPERATIONS_NOT_SUPPORTED_MESSAGE
protected static final String WRITE_OPERATIONS_NOT_SUPPORTED_MESSAGE
A message indicating write operations are not supported in the read-only cache concurrency strategy.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CoherenceReadOnlyEntityAccess
public CoherenceReadOnlyEntityAccess(org.hibernate.cache.spi.DomainDataRegion domainDataRegion, org.hibernate.cache.spi.support.DomainDataStorageAccess domainDataStorageAccess, Comparator<?> versionComparator)Complete constructor.- Parameters:
domainDataRegion- the domain data regionversionComparator- the version comparator
-
-
Method Detail
-
insert
public boolean insert(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version) throws org.hibernate.cache.CacheException- Specified by:
insertin interfaceorg.hibernate.cache.spi.access.EntityDataAccess- Throws:
org.hibernate.cache.CacheException
-
afterInsert
public boolean afterInsert(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version) throws org.hibernate.cache.CacheException- Specified by:
afterInsertin interfaceorg.hibernate.cache.spi.access.EntityDataAccess- Throws:
org.hibernate.cache.CacheException
-
update
public boolean update(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion) throws org.hibernate.cache.CacheException- Specified by:
updatein interfaceorg.hibernate.cache.spi.access.EntityDataAccess- Throws:
org.hibernate.cache.CacheException
-
afterUpdate
public boolean afterUpdate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object currentVersion, Object previousVersion, org.hibernate.cache.spi.access.SoftLock lock) throws org.hibernate.cache.CacheException- Specified by:
afterUpdatein interfaceorg.hibernate.cache.spi.access.EntityDataAccess- Throws:
org.hibernate.cache.CacheException
-
generateCacheKey
public Object generateCacheKey(Object id, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactoryImplementor, String tenantIdentifier)
- Specified by:
generateCacheKeyin interfaceorg.hibernate.cache.spi.access.EntityDataAccess
-
getCacheKeyId
public Object getCacheKeyId(Object cacheKey)
- Specified by:
getCacheKeyIdin interfaceorg.hibernate.cache.spi.access.EntityDataAccess
-
getAccessType
public org.hibernate.cache.spi.access.AccessType getAccessType()
- Specified by:
getAccessTypein interfaceorg.hibernate.cache.spi.access.CachedDomainDataAccess
-
contains
public boolean contains(Object key)
- Specified by:
containsin interfaceorg.hibernate.cache.spi.access.CachedDomainDataAccess
-
getCoherenceRegion
protected CoherenceRegion getCoherenceRegion()
Returns the CoherenceRegion for which this is a AbstractCoherenceEntityDataAccess.- Returns:
- the CoherenceRegion for which this is a AbstractCoherenceEntityDataAccess
-
getRegion
public org.hibernate.cache.spi.DomainDataRegion getRegion()
-
getStorageAccess
protected org.hibernate.cache.spi.support.DomainDataStorageAccess getStorageAccess()
-
getVersionComparator
public Comparator<?> getVersionComparator()
-
getCacheKeysFactory
protected org.hibernate.cache.spi.CacheKeysFactory getCacheKeysFactory()
-
getUuid
protected UUID getUuid()
Returns the UUID of this AbstractCoherenceEntityDataAccess.- Returns:
- the UUID of this AbstractCoherenceEntityDataAccess
-
nextSoftLockSequenceNumber
protected long nextSoftLockSequenceNumber()
Returns the next sequence number for a SoftLock acquired by this AbstractCoherenceEntityDataAccess.- Returns:
- the long that is the next sequence number for a SoftLock acquired by this AbstractCoherenceEntityDataAccess
-
get
public Object get(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key) throws org.hibernate.cache.CacheException
- Throws:
org.hibernate.cache.CacheException
-
putFromLoad
public boolean putFromLoad(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version) throws org.hibernate.cache.CacheException- Throws:
org.hibernate.cache.CacheException
-
putFromLoad
public boolean putFromLoad(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object value, Object version, boolean minimalPutOverride) throws org.hibernate.cache.CacheException- Throws:
org.hibernate.cache.CacheException
-
lockItem
public org.hibernate.cache.spi.access.SoftLock lockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, Object version) throws org.hibernate.cache.CacheException- Throws:
org.hibernate.cache.CacheException
-
lockRegion
public org.hibernate.cache.spi.access.SoftLock lockRegion() throws org.hibernate.cache.CacheException- Throws:
org.hibernate.cache.CacheException
-
unlockItem
public void unlockItem(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key, org.hibernate.cache.spi.access.SoftLock lock) throws org.hibernate.cache.CacheException- Throws:
org.hibernate.cache.CacheException
-
unlockRegion
public void unlockRegion(org.hibernate.cache.spi.access.SoftLock lock) throws org.hibernate.cache.CacheException- Throws:
org.hibernate.cache.CacheException
-
remove
public void remove(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object key) throws org.hibernate.cache.CacheException- Throws:
org.hibernate.cache.CacheException
-
removeAll
public void removeAll(org.hibernate.engine.spi.SharedSessionContractImplementor session) throws org.hibernate.cache.CacheException- Throws:
org.hibernate.cache.CacheException
-
evict
public void evict(Object key) throws org.hibernate.cache.CacheException
- Throws:
org.hibernate.cache.CacheException
-
evictAll
public void evictAll() throws org.hibernate.cache.CacheException- Throws:
org.hibernate.cache.CacheException
-
newCacheValue
protected CoherenceRegionValue newCacheValue(Object value, Object version)
Returns a new cache value with the argument value and version.- Parameters:
value- the value for the new cache valueversion- the version for the new cache value- Returns:
- a CoherenceRegion.Value with the argument value
-
-