3

我正在尝试修改tesla-profiler扩展以支持不同的输出格式以及选择写入文件的路径。

我当前的components.xml定义了一个“渲染器”,它具有探查器所需并由角色提示选择的特定实现,但它现在完全是静态的,它看起来像这样:

<?xml version="1.0" encoding="UTF-8"?>
<component-set>
  <components>
    <component>
      <role>io.tesla.lifecycle.profiler.SessionProfileRenderer</role>
      <role-hint>file-writer</role-hint>
      <implementation>io.tesla.lifecycle.profiler.SessionProfileFileWriter</implementation>
      <configuration>
        <filename>profile.out</filename>
      </configuration>
    </component>
    <component>
      <role>org.apache.maven.eventspy.EventSpy</role>
      <role-hint>tesla-profiler</role-hint>
      <implementation>io.tesla.lifecycle.profiler.LifecycleProfiler</implementation>
      <isolated-realm>false</isolated-realm>
      <requirements>
        <requirement>
          <role>io.tesla.lifecycle.profiler.SessionProfileRenderer</role>
          <role-hint>file-writer</role-hint>
        </requirement>
      </requirements>
    </component>
  </components>
</component-set>

我想知道我是否可以以某种方式对其进行参数化或覆盖,以便我可以从项目的 pom.xml 中选择SessionProfileRenderer要使用的内容,也可以选择渲染器的参数,例如要写入SessionProfileFileWriter.

4

0 回答 0