Portlet Factory, Version 6.1.2


 

Getting cache statistics

An API exists that you can use to get cache statistics. The class com.bowstreet.util.cache.CacheManager is available to return cache data. Refer to the JavaDoc on this class for information about using methods in the class. This class supports the following cache operations:

  • Clear the entire cache. This will clear all the output cache data from all the models in the regenerated model cache.

  • Clear the output cache of a specific model.

  • Enable/disable caching of action output for the entire IBM® WebSphere Portlet Factory server.

  • Get statistics about cache hit/miss rate.

Here is an example from a scripted method:

{ var cacheManager = app.getOutputCacheManager();
// Don't reset stat values var tdData = manager.getCacheStatistics(false); system.debugOut(tdData); return tdData;
}

You can also use the following methods on the Cache Manager to manage the action output cache:

// Enable/Disable Output Caching for the server public void enable(boolean enable)
// Clear the OutputCache for all of the cached models public void clear()
// Clear the OutputCache for the specified model public void clear(String strName)

Parent topic: Cache Control builder


Library | Support |