Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8338603

DiagnosticCommandMBean operations should standardize types for parameters

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • core-svc
    • None

      DiagnosticCommandMBean provides JMX/MBean access to the Diagnostic Commands, as are commonly invoked with jcmd.

      Using DiagnosticCommandMBean, the Diagnostic Commands are MBean Operations, and parameter types are populated from the native hotspot DCmd information.

      The parameter types are not Java types:

      https://docs.oracle.com/en/java/javase/22/docs/api/jdk.management/com/sun/management/DiagnosticCommandMBean.html

      dcmd.arg.type
      "The type of the parameter. The returned String is the name of a type recognized by the diagnostic command parser. These types are not Java types and are implementation dependent."

      It is up to the consumer to know the implementation dependent names that DiagnosticCommandMBean may present.


      DCmds use (and DiagnosticCommandMBean publishes using DiagnosticCommandArgumentInfo) parameter types including:
      BOOLEAN, STRING, INT, "MEMORY SIZE", NANOTIME, "STRING SET", JULONG.
      (This is the set of type names specified in the native DCmds.)

      In jcmd help output, read by a human, these can be a helpful hint to the user. But expecting JMX clients to simply know the list is unrealistic.

            kevinw Kevin Walls
            kevinw Kevin Walls
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: