public interface CachePolicyListener<T>
CachePolicy
and a Cache implementation
to notify about cached object eviction.
Note that CachePolicy
implementations typically use
object equality when removing listeners, so concrete
implementations of this interface should also pay attention to
their Object.equals(Object)
and Object.hashCode()
methods.
Modifier and Type | Method and Description |
---|---|
void |
cacheObjectEvicted(T obj)
Notification that the cache this listener is attached to is evicting
the object indicated.
|
void cacheObjectEvicted(T obj) throws CacheEvictionException
obj
- object being evicted from cacheCacheEvictionException
- if this listener encountered problems
while preparing for the specified object's eviction. For example,
a listener may try to persist the object to disk, and encounter
an IOException
.Copyright © 2003-2012 Apache Software Foundation. All Rights Reserved.