Class EhcacheReadWriteCache

  • All Implemented Interfaces:
    org.hibernate.cache.CacheConcurrencyStrategy

    @Deprecated
    public class EhcacheReadWriteCache
    extends java.lang.Object
    Deprecated.
    Ehcache specific read/write cache concurrency strategy.

    This is the Ehcache specific equivalent to Hibernate's ReadWriteCache. This implementation uses a more robust soft-lock system (less prone to accidental collisions).

    Author:
    Chris Dennis
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected EhCache cache
      Deprecated.
      Ehcache instance this strategy accesses.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean afterInsert​(java.lang.Object key, java.lang.Object value, java.lang.Object version)
      Deprecated.
      boolean afterUpdate​(java.lang.Object key, java.lang.Object value, java.lang.Object version, org.hibernate.cache.access.SoftLock softlock)
      Deprecated.
      void clear()
      Deprecated.
      void destroy()
      Deprecated.
      void evict​(java.lang.Object key)
      Deprecated.
      A No-Op, since we are an asynchronous cache concurrency strategy.
      java.lang.Object get​(java.lang.Object key, long txTimestamp)
      Deprecated.
      org.hibernate.cache.Cache getCache()
      Deprecated.
      java.lang.String getRegionName()
      Deprecated.
      boolean insert​(java.lang.Object key, java.lang.Object value, java.lang.Object currentVersion)
      Deprecated.
      A No-Op, since we are an asynchronous cache concurrency strategy.
      org.hibernate.cache.access.SoftLock lock​(java.lang.Object key, java.lang.Object version)
      Deprecated.
      Soft-locks the associated mapping prior to updating/inserting a new value.
      boolean put​(java.lang.Object key, java.lang.Object value, long txTimestamp, java.lang.Object version, java.util.Comparator versionComparator, boolean minimalPut)
      Deprecated.
      void release​(java.lang.Object key, org.hibernate.cache.access.SoftLock lock)
      Deprecated.
      Soft-unlocks the associated mapping.
      void remove​(java.lang.Object key)
      Deprecated.
      void setCache​(org.hibernate.cache.Cache cache)
      Deprecated.
      boolean update​(java.lang.Object key, java.lang.Object value, java.lang.Object currentVersion, java.lang.Object previousVersion)
      Deprecated.
      A No-Op, since we are an asynchronous cache concurrency strategy.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cache

        protected EhCache cache
        Deprecated.
        Ehcache instance this strategy accesses.
    • Constructor Detail

      • EhcacheReadWriteCache

        public EhcacheReadWriteCache()
        Deprecated.
    • Method Detail

      • get

        public java.lang.Object get​(java.lang.Object key,
                                    long txTimestamp)
                             throws org.hibernate.cache.CacheException
        Deprecated.
        Throws:
        org.hibernate.cache.CacheException
      • put

        public boolean put​(java.lang.Object key,
                           java.lang.Object value,
                           long txTimestamp,
                           java.lang.Object version,
                           java.util.Comparator versionComparator,
                           boolean minimalPut)
                    throws org.hibernate.cache.CacheException
        Deprecated.
        Throws:
        org.hibernate.cache.CacheException
      • lock

        public org.hibernate.cache.access.SoftLock lock​(java.lang.Object key,
                                                        java.lang.Object version)
                                                 throws org.hibernate.cache.CacheException
        Deprecated.
        Soft-locks the associated mapping prior to updating/inserting a new value.
        Throws:
        org.hibernate.cache.CacheException
      • release

        public void release​(java.lang.Object key,
                            org.hibernate.cache.access.SoftLock lock)
                     throws org.hibernate.cache.CacheException
        Deprecated.
        Soft-unlocks the associated mapping.
        Throws:
        org.hibernate.cache.CacheException
      • afterUpdate

        public boolean afterUpdate​(java.lang.Object key,
                                   java.lang.Object value,
                                   java.lang.Object version,
                                   org.hibernate.cache.access.SoftLock softlock)
                            throws org.hibernate.cache.CacheException
        Deprecated.
        Throws:
        org.hibernate.cache.CacheException
      • afterInsert

        public boolean afterInsert​(java.lang.Object key,
                                   java.lang.Object value,
                                   java.lang.Object version)
                            throws org.hibernate.cache.CacheException
        Deprecated.
        Throws:
        org.hibernate.cache.CacheException
      • evict

        public void evict​(java.lang.Object key)
                   throws org.hibernate.cache.CacheException
        Deprecated.
        A No-Op, since we are an asynchronous cache concurrency strategy.
        Throws:
        org.hibernate.cache.CacheException
      • 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
        Deprecated.
        A No-Op, since we are an asynchronous cache concurrency strategy.
        Throws:
        org.hibernate.cache.CacheException
      • insert

        public boolean insert​(java.lang.Object key,
                              java.lang.Object value,
                              java.lang.Object currentVersion)
                       throws org.hibernate.cache.CacheException
        Deprecated.
        A No-Op, since we are an asynchronous cache concurrency strategy.
        Throws:
        org.hibernate.cache.CacheException
      • setCache

        public final void setCache​(org.hibernate.cache.Cache cache)
                            throws org.hibernate.cache.CacheException
        Deprecated.
        Specified by:
        setCache in interface org.hibernate.cache.CacheConcurrencyStrategy
        Throws:
        org.hibernate.cache.CacheException - if the underlying cache is not an Ehcache
      • getCache

        public final org.hibernate.cache.Cache getCache()
        Deprecated.
        Specified by:
        getCache in interface org.hibernate.cache.CacheConcurrencyStrategy
      • getRegionName

        public final java.lang.String getRegionName()
        Deprecated.
        Specified by:
        getRegionName in interface org.hibernate.cache.CacheConcurrencyStrategy
      • remove

        public final void remove​(java.lang.Object key)
                          throws org.hibernate.cache.CacheException
        Deprecated.
        Specified by:
        remove in interface org.hibernate.cache.CacheConcurrencyStrategy
        Throws:
        org.hibernate.cache.CacheException
      • clear

        public final void clear()
                         throws org.hibernate.cache.CacheException
        Deprecated.
        Specified by:
        clear in interface org.hibernate.cache.CacheConcurrencyStrategy
        Throws:
        org.hibernate.cache.CacheException
      • destroy

        public final void destroy()
        Deprecated.
        Specified by:
        destroy in interface org.hibernate.cache.CacheConcurrencyStrategy