code: private void initializeExtension(InstalledExtension installedExtension, String namespaceToLoad,
          Map<String, Set<InstalledExtension>> initializedExtensions) throws ExtensionException
      {
          if (installedExtension.getNamespaces() != null) {
              if (namespaceToLoad == null) {
                  for (String namespace : installedExtension.getNamespaces()) {
                      initializeExtensionInNamespace(installedExtension, namespace, initializedExtensions);
                  }
              } else if (installedExtension.getNamespaces().contains(namespaceToLoad)) {
                  initializeExtensionInNamespace(installedExtension, namespaceToLoad, initializedExtensions);
              }
          } else if (namespaceToLoad == null) {
              initializeExtensionInNamespace(installedExtension, null, initializedExtensions);
          }
      }
docs: Initialize extension.
  
  @param installedExtension the extension to initialize
  @param namespaceToLoad the namespace to be initialized, null for all
  @param initializedExtensions the currently initialized extensions set
  @throws ExtensionException when an initialization error occurs