Interface Cache.Listener
-
- All Known Subinterfaces:
CacheEvictor
- All Known Implementing Classes:
CachedRegionTracker,LeastRecentlyUsedCacheEvictor,NoOpCacheEvictor
- Enclosing interface:
- Cache
public static interface Cache.ListenerListener ofCacheevents.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonSpanAdded(Cache cache, CacheSpan span)Called when aCacheSpanis added to the cache.voidonSpanRemoved(Cache cache, CacheSpan span)Called when aCacheSpanis removed from the cache.voidonSpanTouched(Cache cache, CacheSpan oldSpan, CacheSpan newSpan)Called when an existingCacheSpanis touched, causing it to be replaced.
-
-
-
Method Detail
-
onSpanAdded
void onSpanAdded(Cache cache, CacheSpan span)
Called when aCacheSpanis added to the cache.- Parameters:
cache- The source of the event.span- The addedCacheSpan.
-
onSpanRemoved
void onSpanRemoved(Cache cache, CacheSpan span)
Called when aCacheSpanis removed from the cache.- Parameters:
cache- The source of the event.span- The removedCacheSpan.
-
onSpanTouched
void onSpanTouched(Cache cache, CacheSpan oldSpan, CacheSpan newSpan)
Called when an existingCacheSpanis touched, causing it to be replaced. The newCacheSpanis guaranteed to represent the same data as the one it replaces, howeverCacheSpan.fileandCacheSpan.lastTouchTimestampmay have changed.Note that for span replacement,
onSpanAdded(Cache, CacheSpan)andonSpanRemoved(Cache, CacheSpan)are not called in addition to this method.
-
-