Troubleshoot > Work with Diagnostic Providers > Create a Diagnostic ProviderImplement a Diagnostic Provider
To use a Diagnostic Provider configure an MBean with the methods and attributes required to handle the data from the application server and client applications.
This task presumes that you have a programming knowledge of the creation of MBeans. For more information about the interaction of MBeans with WebSphere Application Server, refer to the creating and registering standard, dynamic, and open custom MBeans information.
The steps that follow outline a general process for implementing a Diagnostic Provider (DP).
- Modify the MBean descriptor Extensible Markup Language (XML). To implement a Diagnostic Provider, we must 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.- Modify the MBean Implementation. Your MBean should already have a class which instantiates it and registers it with the JMX server.
The first difference here is that we must 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.- Implement the Diagnostic Provider methods.
Subtopics
Related
Create and registering standard, dynamic, and open custom MBeans