code: public synchronized MetricsContext getContext(String refName, String contextName)
        throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
      MetricsContext metricsContext = contextMap.get(refName);
      if (metricsContext == null) {
        String classNameAttribute = refName + CONTEXT_CLASS_SUFFIX;
        String className = (String) getAttribute(classNameAttribute);
        if (className == null) {
          className = DEFAULT_CONTEXT_CLASSNAME;
        }
        Class contextClass = Class.forName(className);
        metricsContext = (MetricsContext) contextClass.newInstance();
        metricsContext.init(contextName, this);
        contextMap.put(contextName, metricsContext);
      }
      return metricsContext;
    }
docs: Returns the named MetricsContext instance, constructing it if necessary
  using the factory's current configuration attributes.
  <p/>
  
  When constructing the instance, if the factory property
  <i>contextName</i>.class</code> exists, its value is taken to be the name
  of the class to instantiate. Otherwise, the default is to create an
  instance of <code>org.apache.hadoop.metrics.spi.NullContext</code>, which
  is a dummy "no-op" context which will cause all metric data to be
  discarded.
  
  @param contextName
  the name of the context
  @return the named MetricsContext