MetricsDynamicMBeanBase (Hadoop 0.20.2-CDH3B4 API)
Date: 2011-02-21

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.metrics.util
Class MetricsDynamicMBeanBase

    java.lang.Object
      org.apache.hadoop.metrics.util.MetricsDynamicMBeanBase

All Implemented Interfaces:
  DynamicMBean

Direct Known Subclasses:
  RpcActivityMBean, RpcDetailedActivityMBean

    public abstract class MetricsDynamicMBeanBase

extends Object
implements DynamicMBean

This abstract base class facilitates creating dynamic mbeans automatically from metrics. The metrics constructors registers metrics in a registry. Different categories of metrics should be in differnt classes with their own registry (as in NameNodeMetrics and DataNodeMetrics). Then the MBean can be created passing the registry to the constructor. The MBean should be then registered using a mbean name (example): MetricsHolder myMetrics = new MetricsHolder(); // has metrics and registry MetricsTestMBean theMBean = new MetricsTestMBean(myMetrics.mregistry); ObjectName mbeanName = MBeanUtil.registerMBean("ServiceFoo", "TestStatistics", theMBean);

Constructor Summary
`protected` | `MetricsDynamicMBeanBase(MetricsRegistry mr, String aMBeanDescription)`

Method Summary
`Object` | `getAttribute(String attributeName)`
`AttributeList` | `getAttributes(String[] attributeNames)`
`MBeanInfo` | `getMBeanInfo()`
`Object` | `invoke(String actionName, Object[] parms, String[] signature)`
`void` | `setAttribute(Attribute attribute)`
`AttributeList` | `setAttributes(AttributeList attributes)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MetricsDynamicMBeanBase

    protected MetricsDynamicMBeanBase(MetricsRegistry mr,
                                      String aMBeanDescription)

Method Detail

### getAttribute

    public Object getAttribute(String attributeName)
                        throws AttributeNotFoundException,
                               MBeanException,
                               ReflectionException

  Specified by:
    `getAttribute` in interface `DynamicMBean`
  Throws:
    `AttributeNotFoundException`
    `MBeanException`
    `ReflectionException`

### getAttributes

    public AttributeList getAttributes(String[] attributeNames)

  Specified by:
    `getAttributes` in interface `DynamicMBean`

### getMBeanInfo

    public MBeanInfo getMBeanInfo()

  Specified by:
    `getMBeanInfo` in interface `DynamicMBean`

### invoke

    public Object invoke(String actionName,
                         Object[] parms,
                         String[] signature)
                  throws MBeanException,
                         ReflectionException

  Specified by:
    `invoke` in interface `DynamicMBean`
  Throws:
    `MBeanException`
    `ReflectionException`

### setAttribute

    public void setAttribute(Attribute attribute)
                      throws AttributeNotFoundException,
                             InvalidAttributeValueException,
                             MBeanException,
                             ReflectionException

  Specified by:
    `setAttribute` in interface `DynamicMBean`
  Throws:
    `AttributeNotFoundException`
    `InvalidAttributeValueException`
    `MBeanException`
    `ReflectionException`

### setAttributes

    public AttributeList setAttributes(AttributeList attributes)

  Specified by:
    `setAttributes` in interface `DynamicMBean`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation