5 Replies Latest reply on Jun 20, 2002 11:17 AM by Christian Faucher

    Order of method calls for MBeanRegistration

    Christian Faucher Newbie


      I'm new at JMX implementation. I have a question about the order the methods are calls on my Mbean. I am using JBoss MX (Jboss 3.0 - Tomcat 4.0.3).

      More specifically, I have an DynamicMBean, which implements the MBeanRegistration interface as well. I noticed the methods are called in this order:
      1 - preRegister(...)
      2 - postRegister(...)
      3 - setAttributeList(...)

      Since I need attributes defined in my-service.xml, declaring the MBean, my initialisation fails in preRegister/postRegister, since these attributes are not yet set in my MBean. I am opening an HTTP connection (SOAP server), but I dont know the address to use yet.

      I would have expected an order similar to:
      1 - setAttributeList/setAttribute
      2 - preRegister
      3 - postRegister

      Then, with this order, attributes are known from my-service-xml, and the service can use them to do actions around registration.

      Am i right or wrong to expect this order?

      Christian Faucher
      Tetra Technologies.