RFR: 6875: Add agent MXBean operation to return instrumented xml configuration [v3]

Marcus Hirt hirt at openjdk.java.net
Wed Aug 19 16:53:16 UTC 2020


On Wed, 19 Aug 2020 15:41:58 GMT, Jessye Coleman-Shapiro <jescolem at openjdk.org> wrote:

>> This patch adds the MXBean operation `AgentControllerMXBean.retrieveEventProbes()` to the agent.  This function is the
>> counterpart of `AgentControllerMXBean.defineEventProbes()`.
>
> Jessye Coleman-Shapiro has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add javadoc and test for retrieving an invalid configuration

agent/src/test/java/org/openjdk/jmc/agent/test/TestRetrieveEventProbes.java line 82:

> 81: 		String invalidConfiguration = XML_TEST_DESCRIPTION.concat("</jfragent>");
> 82: 		mbean.defineEventProbes(invalidConfiguration);
> 83: 		Assert.assertEquals(mbean.retrieveEventProbes(), initialConfiguration);

This is just a matter of taste, but I would have expected the definition to fail exceptionally with information about
the invalid configuration, hopefully giving a hint of what went wrong (in the case of e.g. bad XML where the XML went
wrong, simply propagating the exception). And then (just as it is done) let subsequent reads of the configuration
return the last valid one.

-------------

PR: https://git.openjdk.java.net/jmc/pull/99


More information about the jmc-dev mailing list