com.hazelcast.hibernate.region
Class EntityRegionAccessStrategyAdapter

java.lang.Object
  extended by com.hazelcast.hibernate.region.EntityRegionAccessStrategyAdapter
All Implemented Interfaces:
org.hibernate.cache.access.EntityRegionAccessStrategy

public final class EntityRegionAccessStrategyAdapter
extends Object
implements org.hibernate.cache.access.EntityRegionAccessStrategy

Simple adapter implementation for transactional / concurrent access control on entities

Author:
Leo Kim (lkim@limewire.com)

Constructor Summary
EntityRegionAccessStrategyAdapter(AccessDelegate<? extends HazelcastEntityRegion> delegate)
           
 
Method Summary
 boolean afterInsert(Object key, Object value, Object version)
           
 boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, org.hibernate.cache.access.SoftLock lock)
           
 void evict(Object key)
           
 void evictAll()
           
 Object get(Object key, long txTimestamp)
           
 org.hibernate.cache.EntityRegion getRegion()
           
 boolean insert(Object key, Object value, Object version)
           
 org.hibernate.cache.access.SoftLock lockItem(Object key, Object version)
           
 org.hibernate.cache.access.SoftLock lockRegion()
           
 boolean putFromLoad(Object key, Object value, long txTimestamp, Object version)
           
 boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
           
 void remove(Object key)
           
 void removeAll()
           
 void unlockItem(Object key, org.hibernate.cache.access.SoftLock lock)
           
 void unlockRegion(org.hibernate.cache.access.SoftLock lock)
           
 boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityRegionAccessStrategyAdapter

public EntityRegionAccessStrategyAdapter(AccessDelegate<? extends HazelcastEntityRegion> delegate)
Method Detail

afterInsert

public boolean afterInsert(Object key,
                           Object value,
                           Object version)
                    throws org.hibernate.cache.CacheException
Specified by:
afterInsert in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

afterUpdate

public boolean afterUpdate(Object key,
                           Object value,
                           Object currentVersion,
                           Object previousVersion,
                           org.hibernate.cache.access.SoftLock lock)
                    throws org.hibernate.cache.CacheException
Specified by:
afterUpdate in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

evict

public void evict(Object key)
           throws org.hibernate.cache.CacheException
Specified by:
evict in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

evictAll

public void evictAll()
              throws org.hibernate.cache.CacheException
Specified by:
evictAll in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

get

public Object get(Object key,
                  long txTimestamp)
           throws org.hibernate.cache.CacheException
Specified by:
get in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

getRegion

public org.hibernate.cache.EntityRegion getRegion()
Specified by:
getRegion in interface org.hibernate.cache.access.EntityRegionAccessStrategy

insert

public boolean insert(Object key,
                      Object value,
                      Object version)
               throws org.hibernate.cache.CacheException
Specified by:
insert in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

lockItem

public org.hibernate.cache.access.SoftLock lockItem(Object key,
                                                    Object version)
                                             throws org.hibernate.cache.CacheException
Specified by:
lockItem in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

lockRegion

public org.hibernate.cache.access.SoftLock lockRegion()
                                               throws org.hibernate.cache.CacheException
Specified by:
lockRegion in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

putFromLoad

public boolean putFromLoad(Object key,
                           Object value,
                           long txTimestamp,
                           Object version)
                    throws org.hibernate.cache.CacheException
Specified by:
putFromLoad in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

putFromLoad

public boolean putFromLoad(Object key,
                           Object value,
                           long txTimestamp,
                           Object version,
                           boolean minimalPutOverride)
                    throws org.hibernate.cache.CacheException
Specified by:
putFromLoad in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

remove

public void remove(Object key)
            throws org.hibernate.cache.CacheException
Specified by:
remove in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

removeAll

public void removeAll()
               throws org.hibernate.cache.CacheException
Specified by:
removeAll in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

unlockItem

public void unlockItem(Object key,
                       org.hibernate.cache.access.SoftLock lock)
                throws org.hibernate.cache.CacheException
Specified by:
unlockItem in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

unlockRegion

public void unlockRegion(org.hibernate.cache.access.SoftLock lock)
                  throws org.hibernate.cache.CacheException
Specified by:
unlockRegion in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException

update

public boolean update(Object key,
                      Object value,
                      Object currentVersion,
                      Object previousVersion)
               throws org.hibernate.cache.CacheException
Specified by:
update in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.