Using Your Own Policy
Sample Policy
/**
* FIFO Eviction Policy Command
*/
component extends="cachebox.system.cache.policies.AbstractEvictionPolicy"{
/**
* Constructor
* @cacheProvider The associated cache provider of type: cachebox.system.cache.ICacheProvider
*/
FIFO function init( required cacheProvider ){
super.init( arguments.cacheProvider );
return this;
}
/**
* Execute the policy
*/
function execute(){
var index = "";
// Get searchable index
try{
index = getAssociatedCache()
.getObjectStore()
.getIndexer()
.getSortedKeys( "hits", "numeric", "asc" );
// process evictions via the abstract class
processEvictions( index );
}
catch(Any e){
getLogger().error("Error sorting via store indexer #e.message# #e.detail# #e.stackTrace#.");
}
}
}Process Evictions:
Configuration File
Last updated
Was this helpful?