ehcache

net.sf.ehcache.hibernate.nonstop
Class NonstopAwareEntityRegionAccessStrategy

java.lang.Object
  extended by net.sf.ehcache.hibernate.nonstop.NonstopAwareEntityRegionAccessStrategy
All Implemented Interfaces:
org.hibernate.cache.access.EntityRegionAccessStrategy

public class NonstopAwareEntityRegionAccessStrategy
extends Object
implements org.hibernate.cache.access.EntityRegionAccessStrategy

Implementation of EntityRegionAccessStrategy that handles NonStopCacheException using HibernateNonstopCacheExceptionHandler

Author:
Abhishek Sanoujam

Constructor Summary
NonstopAwareEntityRegionAccessStrategy(org.hibernate.cache.access.EntityRegionAccessStrategy actualStrategy, HibernateNonstopCacheExceptionHandler hibernateNonstopExceptionHandler)
          Constructor accepting the actual EntityRegionAccessStrategy and the HibernateNonstopCacheExceptionHandler
 
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

NonstopAwareEntityRegionAccessStrategy

public NonstopAwareEntityRegionAccessStrategy(org.hibernate.cache.access.EntityRegionAccessStrategy actualStrategy,
                                              HibernateNonstopCacheExceptionHandler hibernateNonstopExceptionHandler)
Constructor accepting the actual EntityRegionAccessStrategy and the HibernateNonstopCacheExceptionHandler

Parameters:
actualStrategy -
hibernateNonstopExceptionHandler -
Method Detail

getRegion

public org.hibernate.cache.EntityRegion getRegion()

Specified by:
getRegion in interface org.hibernate.cache.access.EntityRegionAccessStrategy
See Also:
EntityRegionAccessStrategy.getRegion()

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
See Also:
EntityRegionAccessStrategy.afterInsert(java.lang.Object, java.lang.Object, java.lang.Object)

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
See Also:
EntityRegionAccessStrategy.afterUpdate(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, org.hibernate.cache.access.SoftLock)

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
See Also:
EntityRegionAccessStrategy.evict(java.lang.Object)

evictAll

public void evictAll()
              throws org.hibernate.cache.CacheException

Specified by:
evictAll in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException
See Also:
EntityRegionAccessStrategy.evictAll()

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
See Also:
EntityRegionAccessStrategy.get(java.lang.Object, long)

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
See Also:
EntityRegionAccessStrategy.insert(java.lang.Object, java.lang.Object, java.lang.Object)

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
See Also:
EntityRegionAccessStrategy.lockItem(java.lang.Object, java.lang.Object)

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
See Also:
EntityRegionAccessStrategy.lockRegion()

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
See Also:
EntityRegionAccessStrategy.putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, boolean)

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
See Also:
EntityRegionAccessStrategy.putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object)

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
See Also:
EntityRegionAccessStrategy.remove(java.lang.Object)

removeAll

public void removeAll()
               throws org.hibernate.cache.CacheException

Specified by:
removeAll in interface org.hibernate.cache.access.EntityRegionAccessStrategy
Throws:
org.hibernate.cache.CacheException
See Also:
EntityRegionAccessStrategy.removeAll()

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
See Also:
EntityRegionAccessStrategy.unlockItem(java.lang.Object, org.hibernate.cache.access.SoftLock)

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
See Also:
EntityRegionAccessStrategy.unlockRegion(org.hibernate.cache.access.SoftLock)

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
See Also:
EntityRegionAccessStrategy.update(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)

ehcache

Copyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.