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

Add abstract base class to make coding DynamicMBeans easier

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: core-svc
    • Labels:

      Description

      Coding a DynamicMBean is harder than it needs to be. Constructing the MBeanInfo completely by hand is tedious and error-prone. The getAttributes and setAttributes methods have to be written explicitly, even if each of them just consists of calling getAttribute or setAttribute n times. The getAttribute and setAttribute methods frequently consist of a set of lines like this:

        if (attrName.equals("foo"))
          return getFoo();
        else if (attrName.equals("bar"))
          return getBar();
        ...
        else
          throw new AttributeNotFoundException(attrName);

      There should be an easier way.

      The AbstractDynamicMBean class defined by the MX4J project would be a good starting point.
      http://cvs.sourceforge.net/viewcvs.py/mx4j/mx4j/src/core/mx4j/AbstractDynamicMBean.java?view=markup

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: