org.apache.hadoop.metrics.util
Class MetricsDynamicMBeanBase

java.lang.Object
  extended by org.apache.hadoop.metrics.util.MetricsDynamicMBeanBase
All Implemented Interfaces:
DynamicMBean

Deprecated. in favor of org.apache.hadoop.metrics2 usage.

@Deprecated
@InterfaceAudience.LimitedPrivate(value={"HDFS","MapReduce"})
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)
          Deprecated.  
 
Method Summary
 Object getAttribute(String attributeName)
          Deprecated.  
 AttributeList getAttributes(String[] attributeNames)
          Deprecated.  
 MBeanInfo getMBeanInfo()
          Deprecated.  
 Object invoke(String actionName, Object[] parms, String[] signature)
          Deprecated.  
 void setAttribute(Attribute attribute)
          Deprecated.  
 AttributeList setAttributes(AttributeList attributes)
          Deprecated.  
 
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)
Deprecated. 
Method Detail

getAttribute

public Object getAttribute(String attributeName)
                    throws AttributeNotFoundException,
                           MBeanException,
                           ReflectionException
Deprecated. 
Specified by:
getAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
MBeanException
ReflectionException

getAttributes

public AttributeList getAttributes(String[] attributeNames)
Deprecated. 
Specified by:
getAttributes in interface DynamicMBean

getMBeanInfo

public MBeanInfo getMBeanInfo()
Deprecated. 
Specified by:
getMBeanInfo in interface DynamicMBean

invoke

public Object invoke(String actionName,
                     Object[] parms,
                     String[] signature)
              throws MBeanException,
                     ReflectionException
Deprecated. 
Specified by:
invoke in interface DynamicMBean
Throws:
MBeanException
ReflectionException

setAttribute

public void setAttribute(Attribute attribute)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Deprecated. 
Specified by:
setAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException

setAttributes

public AttributeList setAttributes(AttributeList attributes)
Deprecated. 
Specified by:
setAttributes in interface DynamicMBean


Copyright © 2009 The Apache Software Foundation