public ModuleComponent getModuleComponent(String moduleName, String moduleComponentName) {
    for (Module module : modules) {
      ModuleComponent moduleComponent = module.getModuleComponent(moduleComponentName);
      if (null != moduleComponent) {
        return moduleComponent;
      }
    }

    return null;
  }
Gets a component from a given module.

@param moduleName
         the module (service) name.
@param moduleComponentName
         the name of the component.
@return the component or {@code null}.
ambari-server/src/main/java/org/apache/ambari/server/state/Mpack.java