code: private void applyInstallExtension(DefaultInstalledExtension installedExtension, String namespace,
          boolean dependency, Map<String, Object> properties, Map<String, ExtensionDependency> managedDependencies)
          throws InstallException
      {
          // INSTALLED
          installedExtension.setInstalled(true, namespace);
          installedExtension.setInstallDate(new Date(), namespace);
  
          // DEPENDENCY
          installedExtension.setDependency(dependency, namespace);
  
          // Add custom install properties for the specified namespace. The map holding the namespace properties should
          // not be null because it is initialized by the InstalledExtension#setInstalled(true, namespace) call above.
          installedExtension.getNamespaceProperties(namespace).putAll(properties);
  
          // Save properties
          try {
              this.localRepository.setProperties(installedExtension.getLocalExtension(),
                  installedExtension.getProperties());
          } catch (Exception e) {
              throw new InstallException("Failed to modify extension descriptor", e);
          }
  
          // VALID
          installedExtension.setValid(namespace, isValid(installedExtension, namespace, managedDependencies));
  
          // Update caches
  
          addInstalledExtension(installedExtension, namespace);
      }
docs: Install provided extension.
  
  @param localExtension the extension to install
  @param namespace the namespace
  @param dependency indicate if the extension is stored as a dependency of another one
  @param properties the custom properties to set on the installed extension for the specified namespace
  @param managedDependencies the managed dependencies
  @throws InstallException error when trying to uninstall extension
  @see #installExtension(LocalExtension, String)