1 Reply Latest reply on Apr 25, 2002 12:49 PM by Alex Shneyderman

    JMX question

    Alex Shneyderman Newbie

      I just boguht JMX book (which has no forum of its own, hence pardon my question here if it is not appropriate) and was readng it. I got to the XMBean chapter(8) and had a question.
      I have an existing class

      public class TestXMBean {
      String id;

      public TestXMBean() {}

      public void setId (String t) { id = t; }
      public String getId () { return id; }
      public String operateTHEID () { return id; }
      }
      and I wanted to make it a manageable bean. So I created
      an XML description to init XMBean. When I initialize XMBean the class to load is my TestXMBean and my xml description is an instance of xmbean.dtd class of docs. One of the operations in that xml is operateTHEID.

      Now I start up the server and init the XMBean I need. When I go to HTMLAdaptor and try to manipulate my MBean params the TestXMLBean class and the MBean created on the server do not seem to be relating in other words when I execute setId the operation is executed and I can see the attribute is changed. But when I try to execute operateTHEID operation I get null result, which tells me that the class TestXMLBean and MBean that was created and registered on the server are two separate instances. How do I make them to be one and the same?

      PS> There is a reference to XMBeanInfo class in XMBean but it is not found anywhere in the code examples, so I just commented the relevant statements. Maybe this is the source of my confusion