public class ReadWriteCollectionRegionAccessStrategy extends java.lang.Object implements CollectionRegionAccessStrategy
Modifier and Type | Class and Description |
---|---|
protected static class |
org.hibernate.cache.jcache.access.AbstractReadWriteRegionAccessStrategy.Item
Wrapper type representing unlocked items.
|
static class |
org.hibernate.cache.jcache.access.AbstractReadWriteRegionAccessStrategy.Lock
Wrapper type representing locked items.
|
protected static interface |
org.hibernate.cache.jcache.access.AbstractReadWriteRegionAccessStrategy.Lockable
Interface type implemented by all wrapper objects in the cache.
|
Modifier and Type | Field and Description |
---|---|
protected R |
region |
protected java.util.Comparator |
versionComparator |
Constructor and Description |
---|
ReadWriteCollectionRegionAccessStrategy(JCacheCollectionRegion jCacheCollectionRegion) |
Modifier and Type | Method and Description |
---|---|
void |
evict(java.lang.Object key) |
void |
evictAll() |
java.lang.Object |
generateCacheKey(java.lang.Object id,
CollectionPersister persister,
SessionFactoryImplementor factory,
java.lang.String tenantIdentifier)
To create instances of CollectionCacheKey for this region, Hibernate will invoke this method
exclusively so that generated implementations can generate optimised keys.
|
java.lang.Object |
get(SharedSessionContractImplementor session,
java.lang.Object key,
long txTimestamp) |
java.lang.Object |
getCacheKeyId(java.lang.Object cacheKey)
Performs reverse operation to
CollectionRegionAccessStrategy.generateCacheKey(Object, CollectionPersister, SessionFactoryImplementor, String) |
R |
getRegion() |
protected void |
handleMissingLock(java.lang.Object key,
org.hibernate.cache.jcache.access.AbstractReadWriteRegionAccessStrategy.Lockable lock) |
SoftLock |
lockItem(SharedSessionContractImplementor session,
java.lang.Object key,
java.lang.Object version) |
SoftLock |
lockRegion() |
protected long |
nextItemId() |
boolean |
putFromLoad(SharedSessionContractImplementor session,
java.lang.Object key,
java.lang.Object value,
long txTimestamp,
java.lang.Object version) |
boolean |
putFromLoad(SharedSessionContractImplementor session,
java.lang.Object key,
java.lang.Object value,
long txTimestamp,
java.lang.Object version,
boolean minimalPutOverride) |
void |
remove(SharedSessionContractImplementor session,
java.lang.Object key) |
void |
removeAll() |
void |
unlockItem(SharedSessionContractImplementor session,
java.lang.Object key,
SoftLock lock) |
void |
unlockRegion(SoftLock lock) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRegion
evict, evictAll, get, lockItem, lockRegion, putFromLoad, putFromLoad, remove, removeAll, unlockItem, unlockRegion
protected final R extends JCacheTransactionalDataRegion region
protected final java.util.Comparator versionComparator
public ReadWriteCollectionRegionAccessStrategy(JCacheCollectionRegion jCacheCollectionRegion)
public java.lang.Object generateCacheKey(java.lang.Object id, CollectionPersister persister, SessionFactoryImplementor factory, java.lang.String tenantIdentifier)
CollectionRegionAccessStrategy
generateCacheKey
in interface CollectionRegionAccessStrategy
id
- the primary identifier of the Collectionpersister
- the persister for the type for which a key is being generatedfactory
- a reference to the current SessionFactorytenantIdentifier
- the tenant id, or null if multi-tenancy is not being used.public java.lang.Object getCacheKeyId(java.lang.Object cacheKey)
CollectionRegionAccessStrategy
CollectionRegionAccessStrategy.generateCacheKey(Object, CollectionPersister, SessionFactoryImplementor, String)
getCacheKeyId
in interface CollectionRegionAccessStrategy
cacheKey
- key previously returned from CollectionRegionAccessStrategy.generateCacheKey(Object, CollectionPersister, SessionFactoryImplementor, String)
CollectionRegionAccessStrategy.generateCacheKey(Object, CollectionPersister, SessionFactoryImplementor, String)
public R getRegion()
public java.lang.Object get(SharedSessionContractImplementor session, java.lang.Object key, long txTimestamp) throws CacheException
CacheException
public boolean putFromLoad(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value, long txTimestamp, java.lang.Object version) throws CacheException
CacheException
public boolean putFromLoad(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object value, long txTimestamp, java.lang.Object version, boolean minimalPutOverride) throws CacheException
CacheException
public SoftLock lockItem(SharedSessionContractImplementor session, java.lang.Object key, java.lang.Object version) throws CacheException
CacheException
public void unlockItem(SharedSessionContractImplementor session, java.lang.Object key, SoftLock lock) throws CacheException
CacheException
public void remove(SharedSessionContractImplementor session, java.lang.Object key) throws CacheException
CacheException
public void removeAll() throws CacheException
CacheException
public void evict(java.lang.Object key) throws CacheException
CacheException
public void evictAll() throws CacheException
CacheException
public SoftLock lockRegion() throws CacheException
CacheException
public void unlockRegion(SoftLock lock) throws CacheException
CacheException
protected long nextItemId()
protected void handleMissingLock(java.lang.Object key, org.hibernate.cache.jcache.access.AbstractReadWriteRegionAccessStrategy.Lockable lock)
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.