RFR: 7150256: Add back Diagnostic Command JMX API

Frederic Parain frederic.parain at oracle.com
Mon Dec 17 11:27:03 UTC 2012


Please review the following change for CR 7150256.

This changeset is the JDK side of two parts project.

The goal of this feature is to allow remote invocations of
Diagnostic Commands via JMX.

Diagnostic Commands are actually invoked from the jcmd
tool, which is a local tool using the attachAPI. It was
not possible to remotely invoke these commands.
This changeset creates a new PlatformMBean, remotely
accessible via the Platform MBean Server, providing
access to Diagnostic Commands too.

The set of supported Diagnostic Commands varies with
the JVM version, command line options and even some
runtime operations. The new PlatformMBean, called
DiagnosticCommandsMBean is not statically defined,
but computes its content dynamically at runtime.
This is why the MBeanInfo returned by this new
MBean contains a lot of meta-data describing
each supported Diagnostic Command (name, help
message, syntax, etc.)

Because this feature allows remote invocations, it
is important to be able to control who is invoking
and what is invoked. Java Permission checks have
been introduced before a remote invocation request
is forwarded to the JVM. So, each Diagnostic Command
can require a Java Permission to be invoked remotely.
The name of the required Java Permission is provided
in the meta-data in the MBeanInfo.
The security configuration is done using a Security
Manager and the regular JMX configurations. Some
existing Diagnostic Commands have been extended to
specify which Java Permission they require.

The webrev is here:


The second part of this project is the support for this
feature in the HotSpot VM, and is tracked by CR 8004095
(separate request for review will be sent for it).



Frederic Parain - Oracle
Grenoble Engineering Center - France
Phone: +33 4 76 18 81 17
Email: Frederic.Parain at Oracle.com

More information about the core-libs-dev mailing list