It will be very useful to be able to split the content of jmx-datacllection-config.xml into several files on a similar way as we currently do with the XML Collector.
The idea is to keep the current configuration files unmodified, but be able to modify it in the future by just adding an import statement, for example:
The above config assumes that the following files exist on the filesystem: /opt/opennms/etc/mbeans/mbeans-system.xml /opt/opennms/etc/mbeans/mbeans-basic.xml
The content of mbeans-system.xml and mbeans-basic.xml will be the same content as we actually put inside the collections from the tag <mbeans>
2) Create a JMXDataCollectionConfigDao which extends AbstractJaxbConfigDao
3) Refactor JMXDataCollectionConfigFactory in order to use JMXDataCollectionConfigDao and remove all castor dependencies.
4) Re-implement the method translateConfig from JMXDataCollectionConfigDao to support the new tag: <import-mbeans>
5) Create a JUnit test to validate that the old parsing still works and the new one also works. The test is JMXDataCollectionConfigDaoTest
The idea is to create the jmx-datacollection in the main file and define the set of means outside when needed (of course you can put as many import-mbeans tags as needed per jmx-datacollection). I did it that way to have something similar of what it is currently working for SNMP and XML collectors.
So, the root tag for the external files is <mbeans>.
It will be very useful to be able to split the content of jmx-datacllection-config.xml into several files on a similar way as we currently do with the XML Collector.
The idea is to keep the current configuration files unmodified, but be able to modify it in the future by just adding an import statement, for example:
<jmx-datacollection-config rrdRepository="/opt/opennms/rrd/snmp/">
<jmx-collection name="jboss">
<rrd step="300">
<rra>RRA:AVERAGE:0.5:1:8928</rra>
<rra>RRA:AVERAGE:0.5:12:8784</rra>
<rra>RRA:MIN:0.5:12:8784</rra>
<rra>RRA:MAX:0.5:12:8784</rra>
</rrd>
<import-mbeans>mbeans/mbeans-system.xml</import-mbeans>
</jmx-collection>
<jmx-collection name="jsr160">
<rrd step="300">
<rra>RRA:AVERAGE:0.5:1:8928</rra>
<rra>RRA:AVERAGE:0.5:12:8784</rra>
<rra>RRA:MIN:0.5:12:8784</rra>
<rra>RRA:MAX:0.5:12:8784</rra>
</rrd>
<import-mbeans>mbeans/mbeans-basic.xml</import-mbeans>
</jmx-collection>
</jmx-datacollection-config>
The above config assumes that the following files exist on the filesystem:
/opt/opennms/etc/mbeans/mbeans-system.xml
/opt/opennms/etc/mbeans/mbeans-basic.xml
The content of mbeans-system.xml and mbeans-basic.xml will be the same content as we actually put inside the collections from the tag <mbeans>