code: public static synchronized ContextFactory getFactory() throws IOException {
      if (theFactory == null) {
        theFactory = new ContextFactory();
        theFactory.setAttributes();
      }
      return theFactory;
    }
docs: Returns the singleton ContextFactory instance, constructing it if
  necessary.
  <p/>
  
  When the instance is constructed, this method checks if the file
  <code>hadoop-metrics.properties</code> exists on the class path. If it
  exists, it must be in the format defined by java.util.Properties, and all
  the properties in the file are set as attributes on the newly created
  ContextFactory instance.
  
  @return the singleton ContextFactory instance