Diagnostic Provider registered attributes and registered tests

 

+

Search Tips   |   Advanced Search

 

 

Each Diagnostic Provider (DP) provides a list of attributes for...

When performing a dump or test you can request only registered values, or all values. This filter opton is available through the DP's JMX MBean interface, which can be accessed programmatically or through the wsadmin tool. Registered attributes are generally available from one release of WAS to the next. Non-registered attributes might not be available in future releases of the product.

 

DiagnosticProviderRegistration.xml

DiagnosticProviderRegistration.xml is used to filter results.

<attribute>

      <id> Regular Expression representing the attribute name </id>

      <descriptionKey>
          <MsgKey into a ResourceBundle for localization of the label>
      </descriptionKey>

      <registered> true </registered>

</attribute>

...where...

id Attribute name.

Can be expressed with regex wildcards.

Used by methods and Administration console.

For example, if a configuration dump returns an attribute with ID...

cachedServlet-MyServlet-servletPath

...to the console, the console could use the descriptionKey corresponding to the attribute registered as...

<id>cachedServlet-.*-servletPath</id>

...when selecting what description text to put next to this attribute's name and return values.

descriptionKey This is a key into a resourceBundle for localization.
registered Boolean qualifying whether this attribute will be available from one release of the software to the next.

If registered is true, then this attribute should be available in the next release.

If registered is false, then there is no guarantee that this attribute will continue to exist.

Automation should use some caution when handling non-registered attributes.

Specification of a selfDiagnosticTest...

<test>

     <id> Regular Expression for the name of the test </id>

     <descriptionKey>
         <MsgKey into a ResourceBundle for localization of the label>
     </descriptionKey>

     <attribute><One or more attributes which will be output from this test></attribute>

</test>

...where...

id Similar to the ID for the attribute, but in this case, describing the test to be performed instead of the attribute to be returned.
descriptionKey Key into a resourceBundle for localization.

 

Method interfaces

 public DiagnosticEvent [] configDump (
    String aAttributeId, 
    boolean aRegisteredOnly
); public DiagnosticEvent [] stateDump (
    String aAttributeId, 
    boolean aRegisteredOnly
);

These methods invoke the configuration or state dump on the component, and specify a regular expression filter for the attributes to return as well as filtering the output to include all matching attributes, or only those attributes which are registered. This enables the administrator or automated software driving the method to specify a subset of the overall fields (especially important if many attributes are exposed or if the State Collection Specification increases the amount of data available). The following helper methods are available to assist with filtering the output. To take a list of Attributes that are available to return, and filter them:

     public static AttributeInfo [] queryMatchingDPInfoAttributes (
    String aAttributeId,
    AttributeInfo [] inAttrs, 
    String [] namesToCheck, 
    boolean aRegisteredOnly
) 
{

To take a single Attribute that is available to return, and filter it:

     public static AttributeInfo queryMatchingDPInfoAttributes (
    String aAttributeId,
    AttributeInfo [] inAttrs, 
    String nameToCheck, 
    boolean aRegisteredOnly
) 
{

To go through a populated set of Attribute Information and remove unneeded parts:

     public static void filterEventPayload (
    String aAttributeId, H
    ashMap payLoad
) 
{

For details on these messages, please review the API documentation for the DiagnosticProviderHelper class. The basic concept is that, once the component knows what attributes are able to be returned, the helper method will determine which of them should be returned based on the regular expression logic and registration boolean. The selfDiagnostic Method interface here is similar to that of Configdump and Statedump:

public DiagnosticEvent[] selfDiagnostic(String aTestId, boolean aRegisteredOnly)
The difference is that the first parameter is a regular expression filter for which test to run.


 

Related tasks

Work with Diagnostic Providers