Shotoku Renewable Cache installation and configuration

To use the renewable cache, you will need JBoss AS 4.0.x and JBoss Cache 1.4.x.

To install the cache, download and unpack the distribution. There you will find the following files and directories:

  • shotoku-cache.jar - base classes; you should copy this to ${JBOSS_HOME}/server/default/lib (or to a lib directory of any other configuration that you are using). Use this as a dependency jar when developing your cache items.
  • shotoku-cache-service.sar - service which manages the updates and update threads; copy it to ${JBOSS_HOME}/server/default/deploy
  • shotoku-cache-admin.war - administration panel, optional; copy it to ${JBOSS_HOME}/server/default/deploy

When you copy these to the proper destinations, you are almost ready to go. You can define initial configuration of the services in the file shotoku-cache-service.sar/META-INF/jboss-service.xml. There you will find the following mbeans:

  • shotoku:service=RenewableCache - the main mbean, which manages updates and update threads. Attributes:
    • Interval - interval between updates of values managed by active cache items (however cache items may define longer update intervals)
    • UpdateThreadCount - initial number of update threads that will be performing the updates (if there are many cache items, or many keys, you will need more then one update thread, to make the updates efficiently)
    • TreeCache - a tree cache mbean, where values will be held.
  • shotoku:service=RenewableCacheMonitor - a service which monitors the cache items, and when it detects that a key wasn't updated for a long time/ is in update for a long time/ an exception was thrown during a key update, issues an alert, which is visible in the administration console, and can also be sent by e-mail. Attributes:
    • AlertEmail, Smtp* - configuration for sending alert e-mails. If you don't want alert e-mails to be sent, set the user to an empty string.
    • Interval - how often cache items will be monitored.
    • MaximumNumberOfAlerts - maximum number of alerts stored. If the number of alerts exceeds this number, any new ones won't be saved.
    • UpdateAlertIntervalMultiplier - how many times must the interval of a cache item be exceeded, before a "key not updated" or a "key too long in update" alert is issued.
    If you want to disable monitoring completely, simply comment out the mbean definition.

You can change most of these configuration options at run-time, through the administration panel, which, after AS startup, is normally available at http://localhost:8080/shotoku-cache-admin.

JBoss Blog Portlet

Envers 1.0.0.GA released!
Posted on Jul 16, 2008 6:51:30 AM by Adam Warski.

Today the first general availability version of Envers has been released (downloads, release notes). This is a stable version containig all the features found in the preview and beta versions. It does...

Bi-temporal versioning with Envers
Posted on Jun 16, 2008 12:22:43 PM by Adam Warski.

With the recent addition of queries to Envers, it is now possible to easily retrieve data in a bi-temporal way. If you are not familiar with bi-temporal versioning, a good introduction by Martin Fowle...

Envers beta - now with queries!
Posted on Jun 12, 2008 7:03:37 AM by Adam Warski.

So far Envers made it easy to store historical data; now, with version 1.0.0.beta1 (download here), you can also query it, in two “dimensions”: for entities at a given revision and for revisions, at w...

What data should be stored in versions tables? - a poll
Posted on Jun 4, 2008 4:10:28 AM by Adam Warski.

Hello, I’ve posted a poll on what data should be stored in versions tables in Envers, see here and cast your vote: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=136764 The results will dete...

Envers preview 3: logging data for revisions, Seam demo
Posted on May 6, 2008 8:57:24 AM by Adam Warski.

With the preview 3 release of Envers, you can easily associate additional data with revisions. This could be, for example, the name of the user making the change. You simply need to annotate an entity...