Interface LRUHybridCache.CycleHandler<K>
- Type Parameters:
K
- Key type.
- Enclosing class:
LRUHybridCache<K,
V>
public static interface LRUHybridCache.CycleHandler<K>
Should a cycle be detected during computation of a value
for given key, this interface allows client code to register
a callback that would get invoked in such a case.
The cycle is defined as follows. If any thread starts computation
for given key and code from the very same thread requests the computed value
before the computation ends, a cycle is detected.
Registered cycle handler is then given a chance to handle the cycle and
throw a runtime exception if appropriate.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleCycle
(K key) Handle cycle that was detected while computing a cache value for given key.
-
Method Details
-
handleCycle
Handle cycle that was detected while computing a cache value for given key. This method would typically just throw a runtime exception.- Parameters:
key
- instance that caused the cycle.
-