* If the changes to the cache cause the eviction of any objects
* stored under other key(s), events corresponding to
* the evictions are fired for each object. If an event listener is
* unable to handle the eviction, and throws a cache eviction exception,
* that exception is propagated to the caller. If such an exception is
* thrown, the cache itself should be left as it was before the
*
* If this cache policy already contains a listener that is equal to
* the one being added, this call has no effect.
*
* @param listener the (non-null) listener to add to this policy
* @throws IllegalArgumentException if listener is null.
*/
public void addListener( CachePolicyListenerput() operation was invoked: the the object whose
* eviction failed is still in the cache, and the new insertion or
* modification is reverted.
*
* @param key key for the cached object
* @param value the cached object
* @throws CacheEvictionException propagated if, while evicting objects
* to make room for new object, an eviction listener encountered
* this problem.
*/
public void put( K key, V value ) throws CacheEvictionException;
/**
* Obtain the object stored under the key specified.
*
* @param key key the object was cached under
* @return the object if it is still in the cache, null otherwise.
*/
public V get( K key );
/**
* Remove the object stored under the key specified. Note that since
* eviction notices are only fired when objects under different
* keys are evicted, no event is fired for any object stored
* under this key (see {@link #put(Object, Object) put( )}).
*
* @param key key the object was stored in the cache under.
*/
public void remove( K key );
/**
* Remove all objects from the cache. Consistent with
* {@link #remove(Object) remove( )}, no eviction notices are fired.
*/
public void removeAll();
/**
* Enumerate through the objects currently in the cache.
*/
public Enumeration