Class JmxAttributeGauge

  • All Implemented Interfaces:
    Gauge<java.lang.Object>, Metric

    public class JmxAttributeGauge
    extends java.lang.Object
    implements Gauge<java.lang.Object>
    A Gauge implementation which queries a MBeanServer for an attribute of an object.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String attributeName  
      private javax.management.MBeanServer mBeanServer  
      private javax.management.ObjectName objectName  
    • Constructor Summary

      Constructors 
      Constructor Description
      JmxAttributeGauge​(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, java.lang.String attributeName)
      Creates a new JmxAttributeGauge.
      JmxAttributeGauge​(javax.management.ObjectName objectName, java.lang.String attributeName)
      Creates a new JmxAttributeGauge.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getValue()
      Returns the metric's current value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mBeanServer

        private final javax.management.MBeanServer mBeanServer
      • objectName

        private final javax.management.ObjectName objectName
      • attributeName

        private final java.lang.String attributeName
    • Constructor Detail

      • JmxAttributeGauge

        public JmxAttributeGauge​(javax.management.ObjectName objectName,
                                 java.lang.String attributeName)
        Creates a new JmxAttributeGauge.
        Parameters:
        objectName - the name of the object
        attributeName - the name of the object's attribute
      • JmxAttributeGauge

        public JmxAttributeGauge​(javax.management.MBeanServer mBeanServer,
                                 javax.management.ObjectName objectName,
                                 java.lang.String attributeName)
        Creates a new JmxAttributeGauge.
        Parameters:
        mBeanServer - the MBeanServer
        objectName - the name of the object
        attributeName - the name of the object's attribute
    • Method Detail

      • getValue

        public java.lang.Object getValue()
        Description copied from interface: Gauge
        Returns the metric's current value.
        Specified by:
        getValue in interface Gauge<java.lang.Object>
        Returns:
        the metric's current value