1 Reply Latest reply: Apr 15, 2010 2:40 AM by 843798 RSS

    Methods to create an mbeanServer

    800573
      Hi
      I would like to know what is the différence between using ManagementFactory.getPlatformMBeanServer() and
      MBeanServerFactory.createMBeanServer to create an mbeanServer

      Edited by: riadhhwajdii on Apr 14, 2010 4:29 AM

      Edited by: riadhhwajdii on Apr 14, 2010 4:45 AM
        • 1. Re: Methods to create an mbeanServer
          843798
          Hi there,

          both methods return an instance of an MBeanServer to work with. The difference is that the "ManagementFactory.getPlatformMBeanServer()" constructs an MBeanServer internally(by calling MBeanServerFactory.createMBeanServer)
          and registers [platform's MXBeans|http://java.sun.com/javase/6/docs/api/java/lang/management/ManagementFactory.html#MXBean] a set of MBeans that provide useful metrics/info of the java runtime (eg. free memory, garbage collection info, etc).

          Have a look at the documentation of the method

          Hope that helps
          Christos