private void resolveExtension(
          ExtensionModule parentExtension, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions)
          throws AmbariException {
    if (parentExtension.getModuleState() == ModuleState.INIT) {
	  parentExtension.resolve(null, allStacks, commonServices, extensions);
    } else if (parentExtension.getModuleState() == ModuleState.VISITED) {
      //todo: provide more information to user about cycle
      throw new AmbariException("Cycle detected while parsing extension definition");
    }
    if (!parentExtension.isValid() || (parentExtension.getModuleInfo() != null && !parentExtension.getModuleInfo().isValid())) {
      setValid(parentExtension.isValid());
      extensionInfo.setValid(parentExtension.extensionInfo.isValid());
      addErrors(parentExtension.getErrors());
      extensionInfo.addErrors(parentExtension.getErrors());
    }
  }
Resolve another extension module.

@param parentExtension    extension module to be resolved
@param allStacks          all stack modules in stack definition
@param commonServices     all common services specified in the stack definition
@param extensions         all extensions
@throws AmbariException if unable to resolve the extension
ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java