Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5042004

MBeanInfo for Standard MBeans could be got from cache on creation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • core-svc
    • b37
    • generic
    • generic

        From Stefan Guntlin:
        <<<
        we are developing an application using the JMX1.2.1 libraries that registers
        a lot of standard mbeans in the MBeanServer. Most of these mbeans are of the
        same type. We noticed a performance bottleneck in the registering process.
        When a standard mbean is beeing registered, the Method testCompliance(Class
        c) of the class StandardMetaDataImpl.java is called.

           /**
             * This methods tests if the MBean is JMX compliant
             */
            public synchronized void testCompliance(Class c)
                throws NotCompliantMBeanException {
                // ------------------------------
                // ------------------------------


                final MBeanInfo mbeanInfo = buildMBeanInfo(c);
                final Class mbeanInterface = Introspector.getMBeanInterface(c);
                cacheMBeanInfo(c,mbeanInterface,mbeanInfo);

            }


        That means that for every mbean the MBeanInfo is newly built which is quite
        a time consuming operation. Why it is not checked first if the MBeanInfo is
        already in the cache like below?

         if (getCachedMBeanInfo(c)==null) {
              final MBeanInfo mbeanInfo = buildMBeanInfo(c);
              final Class mbeanInterface = Introspector.getMBeanInterface(c);
              cacheMBeanInfo(c, mbeanInterface, mbeanInfo);
            }

        After all the mbeans are standard mbeans and are not supposed to change
        their mbean-interface as long as they are registered in the MBeanServer. Is
        there something I am missing here?
        >>>

              emcmanus Eamonn McManus
              emcmanus Eamonn McManus
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: