The renewable cache is designed to fit one use case: when you need to store some data in a cache, and update it periodically in the background. For example, imagine you have a large configuration file, which determines the layout of your web page. You have to:
As the backing cache, a JBoss Cache tree cache is used (any configured by the user). The renewable cache operates on units called "cache items". Each cache item is bound with one FQN in the associated tree cache. A cache item then creates and stores objects in tree cache keys (attributes).
To create a cache item, you have to implement an interface CacheItemDataSource, which has two functions:
Then you just need to register you cache item datasource, and you can read data from it, using a simple get(key) function. To see an example of a cache item and it's usage, click here.
Shotoku Renewable Cache also comes with an administration panel, which lets you change the configuration (for example update intervals) and monitor the state of the updates (when keys where last updated). Thanks to Ajax4JSF, you don't have to refresh the panel to check if anything has changed: all important parts are refreshed automatically.
Also, in the administration console you can see alerts when:
Check also:
One of the places where the renewable cache is used, is in the software running this site. It was developed as a support project for JBoss Labs, which works on JBoss Portal.
Shotoku Renewable Cache works with JBoss AS 4.0.x and JBoss Cache 1.4.x.
|