[Rev 03] RFR: 6725: Formalize agent probe definition XML schema and enforce validations

Kangcheng Xu kxu at openjdk.java.net
Sat Apr 18 00:21:45 UTC 2020


> This pr implements [JMC-6725: Formalize agent probe definition XML schema and enforce
> validations](https://bugs.openjdk.java.net/browse/JMC-6725). XMLs supplied by users are validated against
> [`jfrprobes_schema.xsd`](https://github.com/tabjy/jmc/blob/a4da862b744f407f3262f006e302515c142e9482/agent/src/main/resources/org/openjdk/jmc/agent/impl/jfrprobes_schema.xsd)
> on registry creation and modification.  Notable changes in configuration probes format are:
> - `<parameter>` elements now should be enclosed by a `<parameters>` element, and
> - `<field>` elements now should be enclosed by a `<fields>` element
> 
> Type checking is enforced on most elements. Additionally, the following types are restricted with regular expressions
> checking elements' text node contents:
> - `classType` for `<class>` and `<converter>` elements
> - `methodNameType` for `<name>` elements
> - `descriptorType` for `<descriptor>` elements
> -  `pathType` for `<path>` elements, and
> - `expressionType` for `<expression>` elements
> 
> Please test, especially on regex, as I'm not entirely confident they cover every cases and don't yield false negatives.

Kangcheng Xu has updated the pull request incrementally with two additional commits since the last revision:

 - add resources folder to .classpath
 - Add unit tests for probe config validation

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

Changes:
  - all: https://git.openjdk.java.net/jmc/pull/66/files
  - new: https://git.openjdk.java.net/jmc/pull/66/files/fc110df0..83af0007

Webrevs:
 - full: https://webrevs.openjdk.java.net/jmc/66/webrev.03
 - incr: https://webrevs.openjdk.java.net/jmc/66/webrev.02-03

  Stats: 394 lines in 6 files changed: 240 ins; 1 del; 153 mod
  Patch: https://git.openjdk.java.net/jmc/pull/66.diff
  Fetch: git fetch https://git.openjdk.java.net/jmc pull/66/head:pull/66

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


More information about the jmc-dev mailing list