private synchronized void readViewArchive(ViewEntity viewDefinition,
                               File archiveFile,
                               File extractedArchiveDirFile,
                               String serverVersion) {

    setViewStatus(viewDefinition, ViewEntity.ViewStatus.DEPLOYING, "Deploying " + extractedArchiveDirFile + ".");

    String extractedArchiveDirPath = extractedArchiveDirFile.getAbsolutePath();

    LOG.info("Reading view archive " + archiveFile + ".");

    try {
      // extract the archive and get the class loader
      List<File> additionalPaths = getViewsAdditionalClasspath(configuration);

      ClassLoader cl = extractor.extractViewArchive(viewDefinition, archiveFile, extractedArchiveDirFile, additionalPaths);

      configureViewLogging(viewDefinition, cl);

      ViewConfig viewConfig = archiveUtility.getViewConfigFromExtractedArchive(extractedArchiveDirPath,
          configuration.isViewValidationEnabled());

      viewDefinition.setConfiguration(viewConfig);

      if (checkViewVersions(viewDefinition, serverVersion)) {
        setupViewDefinition(viewDefinition, cl);

        Set<ViewInstanceEntity> instanceDefinitions = new HashSet<>();

        for (InstanceConfig instanceConfig : viewConfig.getInstances()) {
          ViewInstanceEntity instanceEntity = createViewInstanceDefinition(viewConfig, viewDefinition, instanceConfig);
          instanceEntity.setXmlDriven(true);
          instanceDefinitions.add(instanceEntity);
        }

        persistView(viewDefinition, instanceDefinitions);

        // auto instances of loaded old views for doing data migration can not be installed
        if (getDefinition(viewDefinition.getViewName(), viewDefinition.getVersion()) != null) {
          // add auto instance configurations if required
          addAutoInstanceDefinition(viewDefinition);
        }

        setViewStatus(viewDefinition, ViewEntity.ViewStatus.DEPLOYED, "Deployed " + extractedArchiveDirPath + ".");

        LOG.info("View deployed: " + viewDefinition.getName() + ".");
      }
    } catch (Throwable e) {
      String msg = "Caught exception loading view " + viewDefinition.getName();

      setViewStatus(viewDefinition, ViewEntity.ViewStatus.ERROR, msg + " : " + e.getMessage());
      LOG.error(msg, e);
    }
  }
Extract a view archive at the specified path

@param path
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java