ehcache

net.sf.ehcache.hibernate.nonstop
Class NonstopAwareEntityRegionAccessStrategy

java.lang.Object
  extended by net.sf.ehcache.hibernate.nonstop.NonstopAwareEntityRegionAccessStrategy

public class NonstopAwareEntityRegionAccessStrategy
extends Object

Implementation of EntityRegionAccessStrategy that handles NonStopCacheException using HibernateNonstopCacheExceptionHandler

Author:
Abhishek Sanoujam

Constructor Summary
NonstopAwareEntityRegionAccessStrategy(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, SoftLock lock)
          
 void evict(Object key)
          
 void evictAll()
          
 Object get(Object key, long txTimestamp)
          
 EntityRegion getRegion()
          
 boolean insert(Object key, Object value, Object version)
          
 SoftLock lockItem(Object key, Object version)
          
 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, SoftLock lock)
          
 void unlockRegion(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(EntityRegionAccessStrategy actualStrategy,
                                              HibernateNonstopCacheExceptionHandler hibernateNonstopExceptionHandler)
Constructor accepting the actual EntityRegionAccessStrategy and the HibernateNonstopCacheExceptionHandler

Parameters:
actualStrategy -
hibernateNonstopExceptionHandler -
Method Detail

getRegion

public EntityRegion getRegion()

See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#getRegion()

afterInsert

public boolean afterInsert(Object key,
                           Object value,
                           Object version)
                    throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#afterInsert(java.lang.Object, java.lang.Object, java.lang.Object)

afterUpdate

public boolean afterUpdate(Object key,
                           Object value,
                           Object currentVersion,
                           Object previousVersion,
                           SoftLock lock)
                    throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.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 CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#evict(java.lang.Object)

evictAll

public void evictAll()
              throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#evictAll()

get

public Object get(Object key,
                  long txTimestamp)
           throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#get(java.lang.Object, long)

insert

public boolean insert(Object key,
                      Object value,
                      Object version)
               throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#insert(java.lang.Object, java.lang.Object, java.lang.Object)

lockItem

public SoftLock lockItem(Object key,
                         Object version)
                  throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#lockItem(java.lang.Object, java.lang.Object)

lockRegion

public SoftLock lockRegion()
                    throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#lockRegion()

putFromLoad

public boolean putFromLoad(Object key,
                           Object value,
                           long txTimestamp,
                           Object version,
                           boolean minimalPutOverride)
                    throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.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 CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object)

remove

public void remove(Object key)
            throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#remove(java.lang.Object)

removeAll

public void removeAll()
               throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#removeAll()

unlockItem

public void unlockItem(Object key,
                       SoftLock lock)
                throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#unlockItem(java.lang.Object, org.hibernate.cache.access.SoftLock)

unlockRegion

public void unlockRegion(SoftLock lock)
                  throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#unlockRegion(org.hibernate.cache.access.SoftLock)

update

public boolean update(Object key,
                      Object value,
                      Object currentVersion,
                      Object previousVersion)
               throws CacheException

Throws:
CacheException
See Also:
org.hibernate.cache.access.EntityRegionAccessStrategy#update(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)

ehcache

Copyright 2001-2017, Terracotta, Inc.