|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hazelcast.hibernate.access.AbstractAccessDelegate<T> com.hazelcast.hibernate.access.NonStrictReadWriteAccessDelegate<T> com.hazelcast.hibernate.access.ReadOnlyAccessDelegate<T>
T
- implementation type of HazelcastRegionpublic class ReadOnlyAccessDelegate<T extends HazelcastRegion>
Guarantees that view is read-only and no updates can be made
Field Summary |
---|
Fields inherited from class com.hazelcast.hibernate.access.AbstractAccessDelegate |
---|
cache, hazelcastRegion, log, versionComparator |
Constructor Summary | |
---|---|
ReadOnlyAccessDelegate(T hazelcastRegion,
Properties props)
|
Method Summary | |
---|---|
boolean |
afterUpdate(Object key,
Object value,
Object currentVersion,
Object previousVersion,
SoftLock lock)
Called after an item has been updated (after the transaction completes), instead of calling release(). |
SoftLock |
lockItem(Object key,
Object version)
We are going to attempt to update/delete the keyed object. |
SoftLock |
lockRegion()
NO-OP |
void |
unlockItem(Object key,
SoftLock lock)
This will issue a log warning stating that an attempt was made to unlock an item from a read-only cache region. |
void |
unlockRegion(SoftLock lock)
This will issue a log warning stating that an attempt was made to unlock a read-only cache region. |
boolean |
update(Object key,
Object value,
Object currentVersion,
Object previousVersion)
This is an asynchronous cache access strategy. |
Methods inherited from class com.hazelcast.hibernate.access.NonStrictReadWriteAccessDelegate |
---|
afterInsert, putFromLoad |
Methods inherited from class com.hazelcast.hibernate.access.AbstractAccessDelegate |
---|
evict, evictAll, get, getHazelcastRegion, insert, put, putFromLoad, remove, removeAll, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReadOnlyAccessDelegate(T hazelcastRegion, Properties props)
Method Detail |
---|
public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws org.hibernate.cache.CacheException
AccessDelegate
afterUpdate
in interface AccessDelegate<T extends HazelcastRegion>
afterUpdate
in class NonStrictReadWriteAccessDelegate<T extends HazelcastRegion>
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valuelock
- The lock previously obtained from AccessDelegate.lockItem(java.lang.Object, java.lang.Object)
UnsupportedOperationException
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public SoftLock lockItem(Object key, Object version) throws org.hibernate.cache.CacheException
AccessDelegate
lockItem
in interface AccessDelegate<T extends HazelcastRegion>
lockItem
in class NonStrictReadWriteAccessDelegate<T extends HazelcastRegion>
key
- The key of the item to lockversion
- The item's current version value
UnsupportedOperationException
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public SoftLock lockRegion() throws org.hibernate.cache.CacheException
AbstractAccessDelegate
lockRegion
in interface AccessDelegate<T extends HazelcastRegion>
lockRegion
in class AbstractAccessDelegate<T extends HazelcastRegion>
UnsupportedOperationException
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public void unlockItem(Object key, SoftLock lock) throws org.hibernate.cache.CacheException
unlockItem
in interface AccessDelegate<T extends HazelcastRegion>
unlockItem
in class NonStrictReadWriteAccessDelegate<T extends HazelcastRegion>
key
- The item keylock
- The lock previously obtained from AccessDelegate.lockItem(java.lang.Object, java.lang.Object)
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public void unlockRegion(SoftLock lock) throws org.hibernate.cache.CacheException
unlockRegion
in interface AccessDelegate<T extends HazelcastRegion>
unlockRegion
in class NonStrictReadWriteAccessDelegate<T extends HazelcastRegion>
lock
- The lock previously obtained from AccessDelegate.lockRegion()
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws org.hibernate.cache.CacheException
AbstractAccessDelegate
update
in interface AccessDelegate<T extends HazelcastRegion>
update
in class AbstractAccessDelegate<T extends HazelcastRegion>
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version value
UnsupportedOperationException
org.hibernate.cache.CacheException
- Propogated from underlying org.hibernate.cache.Region
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |