RFR: 6725: Formalize agent probe definition XML schema and enforce validations
Kangcheng Xu
kxu at openjdk.java.net
Fri Mar 13 01:12:22 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.
-------------
Commit messages:
- Update license header year numbers
- Fix test, remove <thread> and <kind> elements
- Define xsd schema, implement and enforce validations
Changes: https://git.openjdk.java.net/jmc/pull/66/files
Webrev: https://webrevs.openjdk.java.net/jmc/66/webrev.00
Issue: https://bugs.openjdk.java.net/browse/JMC-6725
Stats: 618 lines in 6 files changed: 400 ins; 36 del; 182 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