IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins
Interface EvictionEventCallback


public interface EvictionEventCallback

An instance of EvictionEventCallback is passed into the Evictor at initialization time. When an eviction method is called, corresponding methods of EvictionEventCallback will be called so the BackingMap can process evictions.

Since:
WAS XD 6.0, XC10
See Also:
Evictor, EvictorData

Method Summary
 void evictEntries(List keysToEvictList)
          If an Evictor chooses not to implement the EvictorData interface, this method can be used to evict a map entry.
 void evictMapEntries(List evictorDataList)
          This method is the preferred method for the Evictor to use when evicting map entries.
 EvictorData getEvictorData(Object key)
          Gets the evictor data for a specified BackingMap cache entry.
 void setEvictorData(Object key, EvictorData data)
          Sets the evictor data for a specified BackingMap cache key.
 

Method Detail

setEvictorData

void setEvictorData(Object key,
                    EvictorData data)
Sets the evictor data for a specified BackingMap cache key.

This method can be used by an implementor of the Evictor interface to keep data that the evictor needs for determining which cache entry to evict.

Parameters:
key - is the key for accessing a BackingMap entry.
data - the EvictorData object to store as evictor data for a specified key.
Throws:
IllegalArgumentException - if key is a null reference or there is no BackingMap cache entry for this key.
Since:
WAS XD 6.0.1
See Also:
Evictor

getEvictorData

EvictorData getEvictorData(Object key)
Gets the evictor data for a specified BackingMap cache entry.

Parameters:
key - the key for the BackingMap entry to set.
Returns:
if the specified key is not found in BackingMap, then the special value EvictorData.KEY_NOT_FOUND is returned. If the key is found in the BackingMap, the same reference that was previously passed to the setEvictorData(Object, EvictorData) method of this interface is returned. A null reference is returned if the key is found, but the setEvictorData method was not previously called for the specified key.
Throws:
IllegalArgumentException - if key is a null reference.
Since:
WAS XD 6.0.1
See Also:
setEvictorData(Object, EvictorData), EvictorData.KEY_NOT_FOUND

evictMapEntries

void evictMapEntries(List evictorDataList)
                     throws ObjectGridException
This method is the preferred method for the Evictor to use when evicting map entries. A list of EvictorData objects is passed as an argument to this method. For each EvictorData object in the list, the key is obtained from the EvictorData object and used to determine which BackingMap entry to evict. The BackingMap entry is evicted if and only if the cache entry for BackingMap entry contains the exact same EvictorData object in it. That is, the java == operator is used to ensure it is the exact same EvictorData object. If the == operator indicates a different object, then the map entry is not evicted. For those map entries that are physically evicted from the map, the Evictor will receive notification through its apply method.

Parameters:
evictorDataList - a list of EvictorData objects to process. The caller must guarantee this parameter is not null or contain any null references.
Throws:
ObjectGridException - if an error occurs during processing
ClassCastException - if an object in evictorDataList does not implement the EvictorData interface.
Since:
WAS XD 6.0.1
See Also:
Evictor.apply(LogSequence), EvictorData.getKey()

evictEntries

void evictEntries(List keysToEvictList)
                  throws ObjectGridException
If an Evictor chooses not to implement the EvictorData interface, this method can be used to evict a map entry. However, the Evictor must be prepared to handle the exposure of an application removing and recreating a map entry before the Evictor has an opportunity to call this method.

For this method, a list of map keys is passed. The list is evaluated and an eviction is conducted on the list. When the entries are physically evicted from the map, the Evictor will receive notification through its apply method.

Parameters:
keysToEvictList - List of keys to evict from the map. The caller must guarantee this parameter is not null or contain any null references.
Throws:
ObjectGridException - if an error occurs during processing
See Also:
Evictor.apply(LogSequence)

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.