Add abstract base class to make coding DynamicMBeans easier

XMLWordPrintable

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

      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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: