5 Replies Latest reply on Jan 5, 2002 6:46 PM by adrian.brock

    MBean and attributes

    hlship

      I'm new to MBeans and JMX, I'm just trying to integrate the McKoi database into JBoss.

      I've created an MBean and added to jboss.jcml:






      However, it appears (I haven't extensively debugged) that startService() is being invoked before rootPath and configPath are set.

      What is the order of operations here? And what method to I override/implement that gets invoked after the attributes are set?

        • 1. Re: MBean and attributes
          ahjulsta

          You could allways write a constructor taking the necessary arguments. In your jboss-service.xml you would then get code like

          <mbean ...>



          ...


          It doesn't answer your question, but might solve your problem, I guess.

          • 2. Re: MBean and attributes
            simone

            JMX attributes differ from plain JavaBeans properties in the case of the first letter of the attribute name.
            So, in JMX if you have a pair of methods

            public String getRootPath()
            public void setRootPath(String path)

            these define a read/write attribute called 'RootPath', not 'rootPath', while in plain JavaBeans they would identify a property called 'rootPath' (note the case of the first letter).
            Try using


            Hope helped,

            Simon

            • 3. Re: MBean and attributes
              hlship

              That might be it, but shouldn't I see an error that "rootPath" is not a valid property?

              • 4. Re: MBean and attributes
                marc.fleury

                submit a patch with the logic to display that, the logic in 3.0 is in the ServiceController and ServiceConfigurator.java (under org.jboss.system)

                marcf

                • 5. Re: MBean and attributes

                  Hi,

                  ServiceConfigurator already throws a
                  DeploymentException in RH when the attribute cannot be
                  found.

                  Regards,
                  Adrian