3 Replies Latest reply on Nov 16, 2004 3:57 PM by ffrederick

    dynamically create XMBeans?

    chrisdutz

      Hi,

      As I could see in the MBeanServer Interface there is a way to create new MBeans at runtime. How can I dynamically create XMBeans? When defininge them in a jboss-service.xml I have to add the xmbean-dd atrribute to the mbean-tag. So how can I provide the MBeanServer with that infomation?

      Chris

        • 1. Re: dynamically create XMBeans?
          chrisdutz

          I think I found a solution to my problem ... after Googling quite a while.

          Instead of using one of the more komplex registerMBean methods I can create an instance of XMBean with the deployment descriptor as a parameter in it's constructor and simply register it as regular MBean ... sorry for having bothered you.

          Chris

          • 2. Re: dynamically create XMBeans?

            Chris,

            I need to dynamically create an XMBean for a project. I'm not quite following how you would do this from what you have posted. Could you outline the steps in more detail or provide some sample code?

            Thanks

            • 3. Re: dynamically create XMBeans?

              Ok ... I finally get it. Chris is referring to using the constructor for an "XMBean", not the constructor for his xmbean class. To do this, you pass an instance of your mbean (subclass of ServiceMBeanSupport) as the resource to the XMBean construtor and a url to the xml descriptor file.