Creating a Diagnostic Provider
Use Diagnostic Providers to query the startup configuration, current configuration, and current state of a diagnostic domain. Diagnostic Providers also provide access to any self diagnostic tests that are available from a diagnostic domain.
Before you begin
About this task
Procedure
- Determine your diagnostic domain. Look for configuration MBeans that control a similar domain in the same component. Extending an existing configuration MBean with a DP interface avoids proliferation of new MBeans and has the benefit that mapping from a diagnostic MBean to a configuration MBean requires no additional information.
- Determine what configuration attributes you want to expose. Include information that is used to configure your component from the configuration MBeans.
- Determine what state attributes you want to expose. Anything you might want to know about the state of your component for troubleshooting can go here.
- Determine what self diagnostic tests you will expose.
- Determine what test attributes you will return for each self diagnostic.
- Create your DP registration Extensible Markup Language (XML) file.
- Create your DP implementation.
- To see an example, refer to Implementing a Diagnostic Provider and keep in mind that most things that a Diagnostic Provider should do are already done for you in the DiagnosticProviderHelper class.
- To ensure that you do not collect unwanted data, add hooks in your component code where you need to collect state data using the DiagnosticConfig object.
- Add hooks in your component code where you need to store or be able to access configuration data.
- Add code to register your DP implementation. Typically, the best place to do this is where your component is initialized.
- Add Diagnostic Provider IDs (DPID) to your logged messages. Registering a DPID with a logger makes that information available in
any messages logged with this logger. This enables fast paths in the DP utility
to function on this particular Diagnostic Provider.
- Register your DPID with your loggers (for any of your loggers that you only want to associate a single DPID with).
- When you use multiple DPIDs with the same Logger, you can (instead of registering a single DPID with a Logger) add DPIDs to individual logging calls in the parm[0] position. Do not put {0} in the corresponding localized messages. It is bad practice to print the DPID in your messages as this would be inconsistent with messages from loggers with statically assigned DPIDs.
Subtópicos
![[IBM i]](../images/iseries.gif)
Diagnostic Provider Extensible Markup Language
Some conventions to follow for Diagnostic Provider (DP) Extensible Markup Language (XML) declarations.![[IBM i]](../images/iseries.gif)
Choosing a Diagnostic Provider name
To ensure consistency when choosing Diagnostic Provider names to use with your components, you should consider the guidelines that follow.![[IBM i]](../images/iseries.gif)
Implementing a Diagnostic Provider
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.![[IBM i]](../images/iseries.gif)
Creating a Diagnostic Provider registration XML file
The Diagnostic Provider registration XML is used to provide information about the exposed configuration, state, and self diagnostic attributes and tests to the Diagnostic Provider utility. It is also used to populate objects needed later in the process, to assist in filtering, and to assist in localization.
Tópico de Tarefa
Última atualização: July 9, 2016 5:25http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-base-dist&topic=ttrb_createdp
Nome do arquivo: ttrb_createdp.html