private void loadAggregators() {
    Document document = Utils.loadXMLDoc(AGGREGATORS_CONF);

    _aggregatorConfData = new AggregatorConfiguration(document.getDocumentElement()).getAggregatorsConfigurationData();
    for (AggregatorConfigurationData data : _aggregatorConfData) {
      try {
        Class<?> aggregatorClass = Class.forName(data.getClassName());
        Object instance = aggregatorClass.getConstructor(AggregatorConfigurationData.class).newInstance(data);
        if (!(instance instanceof HadoopMetricsAggregator)) {
          throw new IllegalArgumentException("Class " + aggregatorClass.getName() + " is not an implementation of "
              + HadoopMetricsAggregator.class.getName());
        }

        ApplicationType type = data.getAppType();
        if (_typeToAggregator.get(type) == null) {
          _typeToAggregator.put(type, (HadoopMetricsAggregator) instance);
        }

        logger.info("Load Aggregator : " + data.getClassName());
      } catch (ClassNotFoundException e) {
        throw new RuntimeException("Could not find class " + data.getClassName(), e);
      } catch (InstantiationException e) {
        throw new RuntimeException("Could not instantiate class " + data.getClassName(), e);
      } catch (IllegalAccessException e) {
        throw new RuntimeException("Could not access constructor for class" + data.getClassName(), e);
      } catch (RuntimeException e) {
        throw new RuntimeException(data.getClassName() + " is not a valid Aggregator class.", e);
      } catch (InvocationTargetException e) {
        throw new RuntimeException("Could not invoke class " + data.getClassName(), e);
      } catch (NoSuchMethodException e) {
        throw new RuntimeException("Could not find constructor for class " + data.getClassName(), e);
      }
    }

  }
This is a general singleton instance that provides globally accessible resources.

It is not mandatory that an AnalysisPromise implementation must leverage this instance, but this context provides
a way for Promises to access shared objects (singletons, thread-local variables and etc.).
app/com/linkedin/drelephant/ElephantContext.java