Class JMXMonitoringJob


  • public class JMXMonitoringJob
    extends Object
    Class which gathers and returns monitoring information for a single MBean and a specified list of its attributes.
    Author:
    savage
    • Method Detail

      • getMonitoringInfo

        public String getMonitoringInfo​(MBeanServer server)
        Builds a String from the JMXMonitoringJob's MBean. Loops through the attributes being monitored. For each attribute gets the object from the MBeanServer representing it. Gets the key-value pair of the attribute as a string and appends it.
        Parameters:
        server - MBeanServer to get attributes values from.
        Returns:
        Returns a monitoringString which contains key-value metrics.
      • getMBean

        public ObjectName getMBean()
        Returns the MBean monitored by the job.
        Returns:
        The MBean monitored by the job.
      • getAttributes

        public List<String> getAttributes()
        Returns the list of attributes being monitored.
        Returns:
        The attributes being monitored.
      • addAttribute

        public void addAttribute​(String attribute)
        Adds an attribute to be monitored to the job. Will not add an attribute already being monitored.
        Parameters:
        attribute - Name of attribute to be monitored.