Feb 11th, 2009, 09:31 PM
JMX and persistant shared attributes
I'm looking to update one of our applications to allow our marketing people to update some of the application settings in real time. I've been using Spring for a while and I've done some small demo projects with Spring's JMX features so they seemed like I good fit. Some of the basic design constraints I'm looking at are:
1) Our customer signup application is a Spring MVC based webapp running on 3 load balanced Tomcat servers.
2) We want our marketers to be able to change some predefined settings in real time. These would have to be pushed out to all three servers. We making a simple web interface for them.
3) The setting changes would need to be persisted so they would be the same after a server restart.
At this point the business settings are implemented as simple bean attribute values that get injected by Spring and are read from a properties file. Some values are injected into multiple beans. This is all simple and straight forward with Spring.
Just exporting the attributes in JMX doesn't seem like the right way. I don't see any mechanism for making the values persistent. I also don't see to how to handle the case where the same value is used by two different beans.
So my current plan is to create a new bean to hold all the attributes that will be exported with JMX. That bean will be set up to read the attribute values from a properties file when its created and to update the values in the properties file when an attribute is updated via JMX. That handles the persistence part, but what about updating the value in the bean classes? So far I've considered just putting setter calls in my JMX bean, doing reflections tricks to do it or using JMX notifications. But all of these seem like I'm really doing the wrong thing.
Is there some cleaner solution for doing something like this?
Tags for this Thread