[jboss-user] [Management, JMX/JBoss] - persist & auto-restart mbean

cnsxxx09 do-not-reply at jboss.com
Wed Oct 25 12:25:41 EDT 2006


Hi,

How can I persist my mbean's attributes and also get them to restart when JBoss restarts?

I'm *not* physically creating my MBeans and dropping them into the deploy/ directory.
Instead I'm dynamically creating one-to-many instances of the same MBean, as follows:

        MyClass mBean = new myClass();
        ObjectName objectName = new ObjectName("myserver.com:job=MyJob,id=" + myUniqueId);
        server.registerMBean(mBean, objectName); 

I schedule them (via Quartz web app) so I can have many instances in parallel.

I've seen that you need to change parameters in your descriptor files to make MBeans persistent - but as I create them dynamically I don't have descriptors.

Can someone point me to any examples of how to do this?

Similarly, when I restart JBoss (e.g.   if my server crashes) my MBeans no longer exist. Is there any way to register them (as above) but telling JBoss to persist their existence?

Many thanks in advance!

Chris

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980751#3980751

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980751



More information about the jboss-user mailing list