- 
        1. Re: Dynamic Registration of MBeanadrian.brock Mar 16, 2003 8:28 PM (in response to cbono)A sar or your-service.xml 
 Regards,
 Adrian
- 
        2. Re: Dynamic Registration of MBeancbono Mar 17, 2003 11:22 AM (in response to cbono)Adrian, 
 I think my post was a bit misleading. What I am trying to do is programatically register an MBean, not declaratively. I know that I can get ahold of the MBeanServer and call createMBean(clazz,oName) but I am not sure if that call will result in all of the JBoss impl hooks/plumbing to be initialized properly.
- 
        3. Re: Dynamic Registration of MBeancbono Mar 17, 2003 11:26 AM (in response to cbono)I think my post was a bit misleading. I am trying to programatically register an MBean through another MBean. I know that I can do it via MBeanServer.createMBean(clazz,oName) but I am not sure if that will properly call into the impl hooks and initialize it properly. 
 Thanks.
- 
        4. Re: Dynamic Registration of MBeanjuhalindfors Mar 18, 2003 7:09 AM (in response to cbono)Yes, MBeanServer.createMBean() for your own deployer MBean will work. 
- 
        5. Re: Dynamic Registration of MBeancbono Mar 18, 2003 10:51 AM (in response to cbono)Thanks Juha, 
 So what is the best way to get a ref to the MBeanServer impl in JBoss. I believe I can use javax.management.MBeanServerFactory.findMBeanServer(agentID:String). If so, what is the "agentID" that I should use? Is this the most straight forward approach? I like this approach as my code will have 0 proprietary calls in it.
 Thanks.
- 
        6. Re: Dynamic Registration of MBeanadrian.brock Mar 19, 2003 3:03 PM (in response to cbono)There is only one MBeanServer in jboss, 
 simply use the following to get the "first".
 findMBeanServer(null).iterator().next();
 Regards,
 Adrian
 
    