cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

MBean Wizard Extension - Generate an MBean Class from an existing Java Class - UI Specification

Authors: Alexandre Neubert, Thomas levequeJean-Francois Denise

I18N

All localized strings will be in bundle.properties.

Launching the Wizard

The "MBean generation from Java class functionality" is available from the the first panel of the JMX MBean Wizard, which is
launched
by the main menu action File/New File/JMX MBean... . It is located  in the Management category.

Wizard panels

Step 1  Select the Class to wrap as an MBean

The first panel is the usual JMX MBean Wizard Panel.



Scope Of the wizard

Since it is the JMX MBean Wizard, the wizard should be accessible from any kind of project. 

Step 2 Select the class to introspect

This step allows the user to select the Java class to wrap as an MBean.




The "MBean generation from Java class functionality" can be activated by a clic on the checkbox labeled "From existing class".
Since the generated MBean will be an Extended StandardMBean, this option is forced and the other are disabled by this option.



The user may now enter the name of the class he wants to wrap as an MBean directly into the textfield. The Next Button won't
be enabled until the specified class is a valid one.





Once his choises are made, he may continue with the next panels by clicking the Next button.

Step 3  Select Attributes that will appear in the management interface and/or new ones

Note: If the From Existing Class checkbox in the previous panel has not been selected the classic MBean Wizard steps are displayed.

Assuming that the selected class (here CustomDialog) has:
  • some setters and getters, namely
    •  setCount, getCount which respectively take and return an integer value
    •  setCoseOK, getCloseOK which respectively take and return a boolean value
CustomDialog.java will be introspected and the contained elements will be displayed




Here, conformly to the JMX specifications, the accessors are wrapped into the corresponding JMX attributes.
The user can:
  • Clic on the Include column to include/exclude some elements (exclude an element will disable the whole line)
  • Add a description for the keeped elements
  • Change attribute access to Read / Write or ReadOnly
  • Add a new attribute by clicking on the Add Attribute  Button

Step 4  Select Operations that will appear in the management interface and/or new ones

Note: If the From Existing Class checkbox in the second step has not been selected the classic MBean Wizard steps are displayed.

Assuming that the selected class (here CustomDialog) has:

  • one method, namely
    • reset which returns void and has no parameters nor throws any exceptions
CustomDialog.java will be introspected and the contained elements will be displayed



Again, conformly to the JMX specifications, the method is wrapped into a JMX operation.
The user can:
  • Clic on the Include column to include/exclude some elements (exclude an element will disable the whole line)
  • Add a description for the keeped elements
  • Add a new operation by clicking on the Add Operation  Button


Note: The Parameters and Exceptions fields in the wrapped operation are disabled because reset has neither parameters nor exceptions.

Other steps 

The other steps are exactly the same as for the MBean Wizard,  namely:
  • Eventually add notifications
  • Optionnaly generate JUnit tests

Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems