Class DefaultJmxCollector

  • All Implemented Interfaces:
    JmxCollector

    public class DefaultJmxCollector
    extends Object
    implements JmxCollector
    A implementation of the JmxCollector. It iterates over all configured MBeans, collects either attributes or composite members and creates a sample accordingly.
    See Also:
    JmxCollector
    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Constructor Detail

      • DefaultJmxCollector

        public DefaultJmxCollector()
    • Method Detail

      • collect

        public void collect​(JmxCollectorConfig config,
                            MBeanServer mBeanServer,
                            JmxSampleProcessor sampleProcessor)
                     throws JmxServerConnectionException
        Description copied from interface: JmxCollector
        Implements the logic for the jmx data collection.

        Therefore it should somehow: 1. establish the connection to the configured ip address. 2. collect the configured data. 3. inform the JmxSampleProcessor about the collected data.

        The JmxSampleProcessor is a callback for each sample collected. Therefore each sample can be transformed to another data structure (e.g. collectd).

        Specified by:
        collect in interface JmxCollector
        Parameters:
        config - The configuration to use for the collection.
        sampleProcessor - The callback to process each sample.
        Throws:
        JmxServerConnectionException - If the connection to the jmx server could not be established (whatever the reason).