This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

can JMX be used for beans configuration ?

Jun 23rd, 2006, 09:05 AM

Hello,

I used to configure my application using a .properties file (outside the war/ear) that can be customized and reloaded at runtime. Application beans use the commons-configuration interface to get conf datas.

I'd like to use D.I. for those datas : use Spring to set initial value and JMX to reconfigure beans at runtime. This sounds great, but this requires to make new values persistent.

JMX defines a "persist" property on MBeans, but I haven't found a good tutorial too understand it's use. Is there a "standard" way to use the persit capability of MBeans and can I use it as a replacement / complement to properties files ?

This has been discussed several times on this forum (do a search for more info). Basically, Spring JMX adds the JMX layer but it is not a JMX implementation - the underlying impl. takes care of the JMX details like persist. AFAIK, mx4j nor the jdk's jmx impl. do not offer any support for the persist attribute - I think there are some commercial ones that add support for it though I'm not sure.