To use a Diagnostic Provider you must configure an MBean
with the methods and attributes required to handle the data from the
application server and client applications.
Before you begin
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.
About this task
The steps that follow outline a general process for implementing
a Diagnostic Provider (DP).
Procedure
- Modify the MBean descriptor Extensible Markup Language
(XML). To implement a Diagnostic Provider, you 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 you do not need to have this
DP exist in z/OS® Controllers, then this XML inclusion handles
all z/OS specifics for your MBean.
- 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 you 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.