Interface CacheUsageListener


  • public interface CacheUsageListener
    Interface for listeners to any change in usage statistics of an Ehcache.

    Implementations of this interface should implement the Object.equals(Object) and the Object.hashCode() as registering and removing listeners depends on these

    Since:
    1.7
    Author:
    Abhishek Sanoujam
    • Method Detail

      • notifyCacheHitInMemory

        void notifyCacheHitInMemory()
        Called on a cache hit in the MemoryStore
      • notifyCacheHitOffHeap

        void notifyCacheHitOffHeap()
        Called on a cache hit in the off-heap store
      • notifyCacheHitOnDisk

        void notifyCacheHitOnDisk()
        Called on a cache hit in the DiskStore
      • notifyCacheElementPut

        void notifyCacheElementPut()
        Called when an element is inserted in the cache
      • notifyCacheElementUpdated

        void notifyCacheElementUpdated()
        Called when an element is updated in the cache, i.e. a put for an already existing key
      • notifyCacheMissedWithNotFound

        void notifyCacheMissedWithNotFound()
        Called when an element is not found in the cache
      • notifyCacheMissInMemory

        void notifyCacheMissInMemory()
        Called on a cache miss in the MemoryStore
      • notifyCacheMissOffHeap

        void notifyCacheMissOffHeap()
        Called on a cache miss in the off-heap store
      • notifyCacheMissOnDisk

        void notifyCacheMissOnDisk()
        Called on a cache miss in the DiskStore
      • notifyCacheMissedWithExpired

        void notifyCacheMissedWithExpired()
        Called when an element is found in the cache but already expired
      • notifyTimeTakenForGet

        @Deprecated
        void notifyTimeTakenForGet​(long millis)
        Deprecated.
        Notified with time taken for a get operation in the cache DEPRECATED: use notifyGetTimeNanos(long)
        Parameters:
        millis -
      • notifyGetTimeNanos

        void notifyGetTimeNanos​(long nanos)
        Notified with time taken for a get operation in the cache
        Parameters:
        nanos -
      • notifyCacheElementEvicted

        void notifyCacheElementEvicted()
        Called when an element is expired in the cache
      • notifyCacheElementExpired

        void notifyCacheElementExpired()
        Called when an element in the cache expires
      • notifyCacheElementRemoved

        void notifyCacheElementRemoved()
        Called when an element is removed from the cache
      • notifyRemoveAll

        void notifyRemoveAll()
        Called when Cache.removeAll() is called
      • notifyStatisticsAccuracyChanged

        void notifyStatisticsAccuracyChanged​(int statisticsAccuracy)
        Notified when the statistics accuracy is changed.
        Parameters:
        statisticsAccuracy - the statistics accuracy
      • dispose

        void dispose()
        Called to dispose off the listener
      • notifyCacheSearch

        void notifyCacheSearch​(long executeTime)
        Called when a search finishes execution
        Parameters:
        executeTime - elapsed time in millis
      • notifyXaCommit

        void notifyXaCommit()
        Called when the Cache's XAResource has been asked to commit
      • notifyXaRollback

        void notifyXaRollback()
        Called when the Cache's XAResource has been asked to rollback