In addition to programmatically setting a time-to-live (TTL) evictor with the BackingMap
interface, you can use an XML file to configure an evictor on each BackingMap instance.
Before you begin
Before you begin, decide on the type of evictor you are going to use:
The default time-based TTL evictor: The default evictor uses a time-to-live (TTL)
eviction policy for each BackingMap instance.
A pluggable evictor mechanism: Pluggable evictors typically use an eviction policy that
is based on the number of entries instead of on time.
Set the evictor settings before you start your container servers.
Procedure
To set the default TTL evictor, add the ttlEvictorType attribute to the
ObjectGrid descriptor XML file.
The following example shows that the map1 BackingMap instance uses a NONE TTL evictor type. The
map2 BackingMap instance uses either a LAST_ACCESS_TIME or LAST_UPDATE_TIME TTL evictor type.
Specify only one or the other of these settings. The map2 BackingMap instance has a time-to-live
value of 1800 seconds, or 30 minutes. The map3 BackingMap instance is defined to use a CREATION_TIME
TTL evictor type and has a time-to-live value of 1200 seconds, or 20 minutes.
To set a pluggable evictor, use the following example.