Class NonstopAwareEntityRegionAccessStrategy

  • All Implemented Interfaces:
    org.hibernate.cache.access.EntityRegionAccessStrategy

    public class NonstopAwareEntityRegionAccessStrategy
    extends java.lang.Object
    implements org.hibernate.cache.access.EntityRegionAccessStrategy
    Implementation of EntityRegionAccessStrategy that handles NonStopCacheException using HibernateNonstopCacheExceptionHandler
    Author:
    Abhishek Sanoujam
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean afterInsert​(java.lang.Object key, java.lang.Object value, java.lang.Object version)
      boolean afterUpdate​(java.lang.Object key, java.lang.Object value, java.lang.Object currentVersion, java.lang.Object previousVersion, org.hibernate.cache.access.SoftLock lock)
      void evict​(java.lang.Object key)
      void evictAll()
      java.lang.Object get​(java.lang.Object key, long txTimestamp)
      org.hibernate.cache.EntityRegion getRegion()
      boolean insert​(java.lang.Object key, java.lang.Object value, java.lang.Object version)
      org.hibernate.cache.access.SoftLock lockItem​(java.lang.Object key, java.lang.Object version)
      org.hibernate.cache.access.SoftLock lockRegion()
      boolean putFromLoad​(java.lang.Object key, java.lang.Object value, long txTimestamp, java.lang.Object version)
      boolean putFromLoad​(java.lang.Object key, java.lang.Object value, long txTimestamp, java.lang.Object version, boolean minimalPutOverride)
      void remove​(java.lang.Object key)
      void removeAll()
      void unlockItem​(java.lang.Object key, org.hibernate.cache.access.SoftLock lock)
      void unlockRegion​(org.hibernate.cache.access.SoftLock lock)
      boolean update​(java.lang.Object key, java.lang.Object value, java.lang.Object currentVersion, java.lang.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​(java.lang.Object key,
                                   java.lang.Object value,
                                   java.lang.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​(java.lang.Object key,
                                   java.lang.Object value,
                                   java.lang.Object currentVersion,
                                   java.lang.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​(java.lang.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 java.lang.Object get​(java.lang.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​(java.lang.Object key,
                              java.lang.Object value,
                              java.lang.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​(java.lang.Object key,
                                                            java.lang.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​(java.lang.Object key,
                                   java.lang.Object value,
                                   long txTimestamp,
                                   java.lang.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​(java.lang.Object key,
                                   java.lang.Object value,
                                   long txTimestamp,
                                   java.lang.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​(java.lang.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​(java.lang.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​(java.lang.Object key,
                              java.lang.Object value,
                              java.lang.Object currentVersion,
                              java.lang.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)