IBM WebSphere® DataPower® XC10 Appliance
Release 1.0 Client API Specification

com.ibm.websphere.objectgrid.plugins
Interface Evictor

All Known Implementing Classes:
LFUEvictor, LRUEvictor

public interface Evictor

Data contained in a BackingMap are evicted when the map is full. This plugin is used by the BackingMap to determine when and what to evict from the map based on some algorithm (LRU, LFU, time based, etc).

Since:
WAS XD 6.0, XC10
See Also:
BackingMap.setEvictor(Evictor), EvictorData

Method Summary
 void activate()
          This method is called to activate the Evictor.
 void apply(LogSequence sequence)
          Called after a transaction has committed to allow the evictor to track object usage in the BackingMap.
 void deactivate()
          This method is called to deactivate the Evictor.
 void destroy()
          Called when the BackingMap associated with this evictor is destroyed.
 void initialize(BackingMap map, EvictionEventCallback callback)
          Called by a BackingMap instance during the evictor initialization time.
 

Method Detail

initialize

void initialize(BackingMap map,
                EvictionEventCallback callback)

Called by a BackingMap instance during the evictor initialization time.

The BackingMap calls this method so the Evictor instance can have references to the BackingMap and EvictionEventCallback instances. The evictor can signal events to have specific entries evicted using the EvictionEventCallback.

Parameters:
map - the BackingMap instance
callback - the EvictionEventCallback instance
See Also:
BackingMap, EvictionEventCallback

destroy

void destroy()

Called when the BackingMap associated with this evictor is destroyed.

This method is the opposite of the initialize method. When it is called, the Evictor can free up any resources it uses.

See Also:
ObjectGrid.destroy()

apply

void apply(LogSequence sequence)
Called after a transaction has committed to allow the evictor to track object usage in the BackingMap.

This method also reports any entries that have been successfully evicted. Note, this method is not called for transactions that are rolled back. If there is a need to track object usage for rolled back transactions, the evictor must implement the RollbackEvictor interface as well.

This method is called after a transaction has completed. Consequently, all transaction locks that were acquired by the completed transaction are no longer held. Potentially, multiple threads could call this method concurrently and each thread would be completing its own transaction. Since transaction locks are already released by the completed transaction, this method must provide its own synchronization to ensure it is thread safe.

Parameters:
sequence - the LogSequence of changes committed to the map
See Also:
RollbackEvictor

activate

void activate()
This method is called to activate the Evictor. Until this method is called, the Evictor must not use the EvictionEventCallback interface to evict any map entries. If it does use the EvictionEventcallback interface to evict map entries prior to activate being called, an IllegalStateException is thrown.


deactivate

void deactivate()
This method is called to deactivate the Evictor. Once this method is called, the Evictor must quit using the EvictionEventCallback interface to evict any map entries. If it does use the EvictionEventcallback interface after this method is called, an IllegalStateException is thrown.


IBM WebSphere® DataPower® XC10 Appliance
Release 1.0 Client API Specification

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