Interface AccessDelegate

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean afterInsert​(Object session, Object key, Object value, Object version)
      Called after an item has been inserted (after the transaction completes), instead of calling release().
      boolean afterUpdate​(Object session, Object key, Object value, Object currentVersion, Object previousVersion, org.hibernate.cache.spi.access.SoftLock lock)
      Called after an item has been updated (after the transaction completes), instead of calling release().
      void evict​(Object key)
      Forcibly evict an item from the cache immediately without regard for transaction isolation.
      void evictAll()
      Forcibly evict all items from the cache immediately without regard for transaction isolation.
      Object get​(Object session, Object key, long txTimestamp)  
      boolean insert​(Object session, Object key, Object value, Object version)
      Called after an item has been inserted (before the transaction completes), instead of calling evict().
      boolean putFromLoad​(Object session, Object key, Object value, long txTimestamp, Object version)
      Attempt to cache an object, after loading from the database.
      boolean putFromLoad​(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
      Attempt to cache an object, after loading from the database, explicitly specifying the minimalPut behavior.
      void remove​(Object session, Object key)
      Called after an item has become stale (before the transaction completes).
      void removeAll()
      Called to evict data from the entire region
      void unlockItem​(Object session, Object key)
      Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion.
      boolean update​(Object session, Object key, Object value, Object currentVersion, Object previousVersion)
      Called after an item has been updated (before the transaction completes), instead of calling evict().
    • Method Detail

      • get

        Object get​(Object session,
                   Object key,
                   long txTimestamp)
            throws org.hibernate.cache.CacheException
        Throws:
        org.hibernate.cache.CacheException
      • putFromLoad

        boolean putFromLoad​(Object session,
                            Object key,
                            Object value,
                            long txTimestamp,
                            Object version)
        Attempt to cache an object, after loading from the database.
        Parameters:
        session - Current session
        key - The item key
        value - The item
        txTimestamp - a timestamp prior to the transaction start time
        version - the item version number
        Returns:
        true if the object was successfully cached
      • putFromLoad

        boolean putFromLoad​(Object session,
                            Object key,
                            Object value,
                            long txTimestamp,
                            Object version,
                            boolean minimalPutOverride)
                     throws org.hibernate.cache.CacheException
        Attempt to cache an object, after loading from the database, explicitly specifying the minimalPut behavior.
        Parameters:
        session - Current session.
        key - The item key
        value - The item
        txTimestamp - a timestamp prior to the transaction start time
        version - the item version number
        minimalPutOverride - Explicit minimalPut flag
        Returns:
        true if the object was successfully cached
        Throws:
        org.hibernate.cache.CacheException - Propogated from underlying Region
      • insert

        boolean insert​(Object session,
                       Object key,
                       Object value,
                       Object version)
                throws org.hibernate.cache.CacheException
        Called after an item has been inserted (before the transaction completes), instead of calling evict().
        Parameters:
        session - Current session
        key - The item key
        value - The item
        version - The item's version value
        Returns:
        Were the contents of the cache actual changed by this operation?
        Throws:
        org.hibernate.cache.CacheException - if the insert fails
      • update

        boolean update​(Object session,
                       Object key,
                       Object value,
                       Object currentVersion,
                       Object previousVersion)
                throws org.hibernate.cache.CacheException
        Called after an item has been updated (before the transaction completes), instead of calling evict().
        Parameters:
        session - Current session
        key - The item key
        value - The item
        currentVersion - The item's current version value
        previousVersion - The item's previous version value
        Returns:
        Whether the contents of the cache actual changed by this operation
        Throws:
        org.hibernate.cache.CacheException - if the update fails
      • remove

        void remove​(Object session,
                    Object key)
             throws org.hibernate.cache.CacheException
        Called after an item has become stale (before the transaction completes).
        Parameters:
        session - Current session
        key - The key of the item to remove
        Throws:
        org.hibernate.cache.CacheException - if removing the cached item fails
      • removeAll

        void removeAll()
                throws org.hibernate.cache.CacheException
        Called to evict data from the entire region
        Throws:
        org.hibernate.cache.CacheException - if eviction the region fails
      • evict

        void evict​(Object key)
            throws org.hibernate.cache.CacheException
        Forcibly evict an item from the cache immediately without regard for transaction isolation.
        Parameters:
        key - The key of the item to remove
        Throws:
        org.hibernate.cache.CacheException - if evicting the item fails
      • evictAll

        void evictAll()
               throws org.hibernate.cache.CacheException
        Forcibly evict all items from the cache immediately without regard for transaction isolation.
        Throws:
        org.hibernate.cache.CacheException - if evicting items fails
      • unlockItem

        void unlockItem​(Object session,
                        Object key)
                 throws org.hibernate.cache.CacheException
        Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion. This method is used by "asynchronous" concurrency strategies.
        Parameters:
        session -
        key - The item key
        Throws:
        org.hibernate.cache.CacheException - Propogated from underlying Region
      • afterInsert

        boolean afterInsert​(Object session,
                            Object key,
                            Object value,
                            Object version)
        Called after an item has been inserted (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.
        Parameters:
        session -
        key - The item key
        value - The item
        version - The item's version value
        Returns:
        Were the contents of the cache actual changed by this operation?
        Throws:
        org.hibernate.cache.CacheException - Propagated from underlying Region
      • afterUpdate

        boolean afterUpdate​(Object session,
                            Object key,
                            Object value,
                            Object currentVersion,
                            Object previousVersion,
                            org.hibernate.cache.spi.access.SoftLock lock)
        Called after an item has been updated (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.
        Parameters:
        session -
        key - The item key
        value - The item
        currentVersion - The item's current version value
        previousVersion - The item's previous version value
        lock - The lock previously obtained from #lockItem
        Returns:
        Were the contents of the cache actual changed by this operation?
        Throws:
        org.hibernate.cache.CacheException - Propagated from underlying Region