Reputation: 5771
Let's say I have a Java webapp deployed on some Application Server with clustering across a few nodes.
In the webapp, we maintain a cache of some values retrieved from the database, stored in-memory as static variables. Whenever a user performs an update in a particular screen, we clear the cache so that the cached values will be retrieved again the next time they are needed.
Now the problem: Since each node in the cluster is running on a separate JVM, how can I clear the cache across all nodes? Basically I want to call a static function on each cluster node. Is there some standard J2EE way to do this, or it depends on the Application Server software?
Upvotes: 3
Views: 989
Reputation: 1400
On a 'standard' application server like Jboss you could use JMX or Message Beans for that.
Upvotes: 1