2 Replies Latest reply on Sep 15, 2003 7:41 AM by andrewboyd

    Getting MBeanServerDelegate

    andrewboyd

      Hi,
      If I create an MBeanServer with:
      MBeanServerFactory.createMBeanServer(Host.DOMAIN);

      How can I get its MBeanServerDelegate?

      I want the MBeanServerDelegate so I can get the AgentID via:

      MBeanServerDelegate.getMBeanServerId()

      Then I can use the MBeanServerFactory.findMBeanServer(String agentID)

      Thanks in advance,

      Andrew

        • 1. Re: Getting MBeanServerDelegate

          The MBean Delegate is always registered to a fixed object name: JMImplementation:type=MBeanServerDelegate

          -- Juha

          • 2. Re: Getting MBeanServerDelegate
            andrewboyd

            Thanks for the advice. That works fine. Here is my code incase anyone else wants it.

            delegate = new ObjectName("JMImplementation:type=MBeanServerDelegate");
            kafeMbeanServer_ = MBeanServerFactory.createMBeanServer(Host.DOMAIN);
            logger_.debug("Getting MBeanServerId from kafeMBeanServer");
            agentID = (String) kafeMbeanServer_.getAttribute(delegate, "MBeanServerId");

            -Andrew