RFR: 6724: Agent argument as a path to a probe definition XML should be optional

Marcus Hirt hirt at openjdk.java.net
Tue Mar 10 09:40:49 UTC 2020


On Mon, 9 Mar 2020 18:09:13 GMT, Kangcheng Xu <kxu at openjdk.org> wrote:

> This patch addresses [JMC-6724: Agent argument as a path to a probe definition XML should be
> optional](https://bugs.openjdk.java.net/browse/JMC-6724). It makes the agent argument optional and probes can always be
> defined later via JMX. If such an argument is missing, an empty registry is created with no transform descriptor.

.

agent/src/main/java/org/openjdk/jmc/agent/Agent.java line 105:

> 104: 		TransformRegistry registry =
> 105: 				configuration != null ? DefaultTransformRegistry.from(configuration) : DefaultTransformRegistry.empty();
> 106: 		instrumentation.addTransformer(new Transformer(registry), true);

Nit: should document that null as argument for the configuration stream means using the empty configuration.

agent/src/main/java/org/openjdk/jmc/agent/Agent.java line 134:

> 133: 			} catch (XMLStreamException e) {
> 134: 				// noop
> 135: 			}

Nit: perhaps document with something like // noop since null causes defaults to be used - the stream will not be used

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

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


More information about the jmc-dev mailing list