+

Search Tips   |   Advanced Search

Implement a Diagnostic Provider


To use a Diagnostic Provider configure an MBean with the methods and attributes required to handle the data from the appserver and client applications.

This task presumes that we have a programming knowledge of the creation of MBeans.

See about the interaction of MBeans with WAS, refer to Create and registering standard, dynamic, and open custom MBeans.

The steps that follow outline a general process for implementing a Diagnostic Provider (DP).

 

  1. Modify the MBean descriptor XML.

    To implement a Diagnostic Provider, have an MBean, and the MBean should include this statement in its descriptor XML as a direct child of the MBean element:

    <parentType type="DiagnosticProvider"/>
    

    This defines the operations, attributes, and aggregators necessary for an MBean to be a Diagnostic Provider. If we do not need to have this DP exist in z/OS Controllers, then this XML inclusion handles all z/OS specifics for the MBean.

  2. Modify the MBean Implementation. Your MBean should already have a class which instantiates it and registers it with the Java Management Extensions (JMX) server. The first difference here is that define a property in the Properties class that is passed to the registration (and becomes part of the ObjectName). The property is diagnosticProvider=true and it can be added with a line of code such as:

     MyProps.setProperty(DiagnosticProvider.DIAGNOSTIC_PROVIDER_KEY, DiagnosticProvider.DIAGNOSTIC_PROVIDER_VALUE) ;
    
    The second difference is that this class should register this Diagnostic Provider with the Diagnostic Service. A helper method is available to do this:

     DiagnosticProviderHelper.registerMBeanWithDiagnosticService(DiagnosticProviderPName, DiagnosticProviderId) ; 
    

    Obviously this must be done after the registration when the ObjectName can be retrieved into the DiagnosticProviderId string.

  3. Implement the Diagnostic Provider methods.


Diagnostic Provider method implementation