Interface ReplacementPolicy.Callback
-
- All Known Implementing Classes:
ClockPolicy.Holder
- Enclosing interface:
- ReplacementPolicy
public static interface ReplacementPolicy.CallbackThe interface for the callback objects thatConcurrentCacheuses to notify the replacement algorithm about events such as look-ups and removals. EachCallbackobject is associated with a single entry in the cache.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccess()Notify the replacement algorithm that the cache entry has been accessed.voidfree()Notify the replacement algorithm that the entry associated with this callback object has been removed, and the callback object and theCacheablecan be reused.
-
-
-
Method Detail
-
access
void access()
Notify the replacement algorithm that the cache entry has been accessed. The replacement algorithm can use this information to collect statistics about access frequency which can be used to determine the order of evictions.The entry associated with the callback object must be locked by the current thread.
-
free
void free()
Notify the replacement algorithm that the entry associated with this callback object has been removed, and the callback object and theCacheablecan be reused.The entry associated with the callback object must be locked by the current thread.
-
-