...or alternatively, can Tomcat be used to provide clustering?
JBoss Cache can function and cluster just fine outside of an app server. An example of how to start one programatically:
TreeCache tree=new TreeCache(); PropertyConfigurator config=new PropertyConfigurator(); config.configure(tree, "replAsync-service.xml"); // read in config file from classpath tree.createService(); tree.startService();
All caches on the network which share a common JGroups protocol stack definition in their config file will see each other and cluster.
Great, thanks Brian.
Also just found an example deployment in Tomcat :)
You can't use the cluster communication layer that comes with Tomcat to provide communication between JBoss Cache instances.
But, you can run JBoss Cache inside Tomcat; the code I just posted will work fine inside a web tier component running in Tomcat.