I have a Dynamic MBean that I want to add persistence for without modifying the code. It is dynamic because we add and remove attributes at runt time. As I understand the JMX related DTDs, a persistence manager can only be defined for XMBeans.
Is there any way I can combine these properties of Dynamic MBeans and XMBeans ?
You would need to extend the existing ModelMBean implementation as this is the only mbean with a notion of server managed persistence. Look into the XMBean code and look how to provide runtime modification of the ModelMBeanInfo.