3 Replies Latest reply on Mar 28, 2005 4:22 PM by jimm

    xmbeans, interfaces and lifecycle

    Eric Freed Newbie

      I am trying to get a handle on xmbeans and their lifecycle, and I am confused.

      In the jboss4 manual, section 2.4.3.2, the xmbean example says the xmbean example class JNDIMap "will not implement and specific management related interface." And that confused me. If there is no implemented interface, what methods are called on the created object, and when? Does that mean I can I define my own lifecycle methods?

      And the example code does extend ServiceMBeanSupport.

      So I am confused.

      Many thanks,
      Eric Freed

        • 1. Re: xmbeans, interfaces and lifecycle
          jimm Newbie

          I think that quote from the manual refers to the fact that an XMBean does not have to implement an XXXMBean interface like standard MBeans must in order to expose the JMX ("management") attributes and operations. This is talking about standard JMX functionality. Lifecycle operation are not part of the JMX spec.

          You still implement the org.jboss.system.Service interface if you want your XMBean to be a service (have a lifecycle). As you have pointed out extending ServiceMBeanSupport is an easy way to do this. In this case it is also important that your XMBean definition include these lifecycle methods. You can use '&defaultAttributes;' and '&defaultOperations;' to have them included automatically.

          A good place to see examles is in the [jboss]/server/default/conf/xmdesc directory.

          • 2. Re: xmbeans, interfaces and lifecycle
            Eric Freed Newbie

            That clears it up. But I have not seen anything about
            &defaultOperations;
            or
            &defaultAttributes;

            (The fact that they exists makes the whole thing clearer in my head).

            But did I just miss them in the docs?


            • 3. Re: xmbeans, interfaces and lifecycle
              jimm Newbie

              I do not know if it is in the Application Server Guide but I know it is in my favorite place to find XMBean documentation.......
              [jboss install]/docs/dtd/jboss_xmbean_1_2.dtd