IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins
Interface MapEventListener

All Superinterfaces:
EventListener

public interface MapEventListener
extends EventListener

This callback interface is implemented by the application when it wants to receive events about a Map such as the eviction of a map entry.

Since:
WAS XD 6.0, XC10
See Also:
BackingMap.addMapEventListener(EventListener), BackingMap.removeMapEventListener(EventListener), EventListener

Method Summary
 void entryEvicted(Object key, Object value)
          Invoked when the specified entry is evicted from the map.
 void preloadCompleted(Throwable t)
          Invoked when the preloading of this map has completed.
 

Method Detail

entryEvicted

void entryEvicted(Object key,
                  Object value)
Invoked when the specified entry is evicted from the map.

The eviction could have occurred either by an Evictor's processing or by invoking one of the invalidate methods on the ObjectMap.

For a MapEventListener in an ObjectMap that is configured to use OutputFormat.RAW for the keys and values, the keys and values objects passed will be SerializedKey or SerializedValue objects respectively. If required, you can use the SerializedEntry.getObject() method to retrieve (possibly inflating the serialized object) the original key or value object.

To override the map's output format configuration, use the PluginOutputFormat annotation in the implementation class.

Parameters:
key - The key for the map entry that was evicted.
value - The value that was in in the map entry evicted. The value object should not be modified.
See Also:
Evictor, EvictionEventCallback, ObjectMap.invalidate(Object, boolean)

preloadCompleted

void preloadCompleted(Throwable t)
Invoked when the preloading of this map has completed.

This method is useful to determine when a preload operation finishes if asynchronous preloading is enabled. In addition if any error occurred during synchronous or asynchronous preload, it is reported with the invocation of this method.

Parameters:
t - A Throwable object that indicates if preload completed without any Throwable occuring during the preload of the map. A null reference indicates preload completed without any Throwable objects occuring during the preload of the map.
See Also:
Loader.preloadMap(Session, BackingMap), BackingMap.setPreloadMode(boolean)

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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