public abstract class AbstractReadWriteMemcachedAccessStrategy<T extends AbstractMemcachedRegion> extends AbstractMemcachedAccessStrategy<T>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractReadWriteMemcachedAccessStrategy.Item
Wrapper type representing unlocked items.
|
protected static class |
AbstractReadWriteMemcachedAccessStrategy.Lock
Wrapper type representing locked items.
|
protected static interface |
AbstractReadWriteMemcachedAccessStrategy.Lockable
Interface type implemented by all wrapper objects in the cache.
|
region| Constructor and Description |
|---|
AbstractReadWriteMemcachedAccessStrategy(T region,
org.hibernate.boot.spi.SessionFactoryOptions settings,
org.hibernate.cache.spi.CacheDataDescription cacheDataDescription)
Creates a read/write cache access strategy around the given cache region.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
decrementLock(Object key,
AbstractReadWriteMemcachedAccessStrategy.Lock lock)
Unlock and re-put the given key, lock combination.
|
Object |
get(org.hibernate.engine.spi.SessionImplementor session,
Object key,
long txTimestamp)
Returns
null if the item is not readable. |
protected void |
handleLockExpiry(Object key,
AbstractReadWriteMemcachedAccessStrategy.Lockable lock)
Handle the timeout of a previous lock mapped to this key
|
org.hibernate.cache.spi.access.SoftLock |
lockItem(org.hibernate.engine.spi.SessionImplementor session,
Object key,
Object version)
Soft-lock a cache item.
|
boolean |
putFromLoad(org.hibernate.engine.spi.SessionImplementor session,
Object key,
Object value,
long txTimestamp,
Object version,
boolean minimalPutOverride)
Returns
false and fails to put the value if there is an existing un-writeable item mapped to this
key. |
void |
unlockItem(org.hibernate.engine.spi.SessionImplementor session,
Object key,
org.hibernate.cache.spi.access.SoftLock lock)
Soft-unlock a cache item.
|
evict, evictAll, getRegion, lockRegion, putFromLoad, region, remove, removeAll, settings, unlockRegionpublic AbstractReadWriteMemcachedAccessStrategy(T region, org.hibernate.boot.spi.SessionFactoryOptions settings, org.hibernate.cache.spi.CacheDataDescription cacheDataDescription)
public final Object get(org.hibernate.engine.spi.SessionImplementor session, Object key, long txTimestamp) throws org.hibernate.cache.CacheException
null if the item is not readable. Locked items are not readable, nor are items created
afterQuery the start of this transaction.org.hibernate.cache.CacheExceptionpublic final boolean putFromLoad(org.hibernate.engine.spi.SessionImplementor session,
Object key,
Object value,
long txTimestamp,
Object version,
boolean minimalPutOverride)
throws org.hibernate.cache.CacheException
false and fails to put the value if there is an existing un-writeable item mapped to this
key.putFromLoad in class AbstractMemcachedAccessStrategy<T extends AbstractMemcachedRegion>org.hibernate.cache.CacheExceptionpublic final org.hibernate.cache.spi.access.SoftLock lockItem(org.hibernate.engine.spi.SessionImplementor session,
Object key,
Object version)
throws org.hibernate.cache.CacheException
org.hibernate.cache.CacheExceptionpublic final void unlockItem(org.hibernate.engine.spi.SessionImplementor session,
Object key,
org.hibernate.cache.spi.access.SoftLock lock)
throws org.hibernate.cache.CacheException
org.hibernate.cache.CacheExceptionprotected void decrementLock(Object key, AbstractReadWriteMemcachedAccessStrategy.Lock lock)
protected void handleLockExpiry(Object key, AbstractReadWriteMemcachedAccessStrategy.Lockable lock)
Copyright © 2017. All rights reserved.