public synchronized Collection<AvailableService> getAvailableServices(StackInfo stack) {
    if (null == m_availableMap) {
      Map<String, ManifestService> manifests = buildManifest();
      m_availableMap = new HashMap<>();

      if (availableServices.isEmpty()) {
        // !!! populate available services from the manifest
        for (ManifestService ms : manifests.values()) {
          addToAvailable(ms, stack, Collections.emptySet());
        }
      } else {
        for (AvailableServiceReference ref : availableServices) {
          ManifestService ms = manifests.get(ref.serviceIdReference);

          addToAvailable(ms, stack, ref.components);
        }
      }
    }

    return m_availableMap.values();
  }
@param stack the stack info needed to lookup service and component display names
@return a collection of AvailableServices used for web service consumption.  This
collection is either the subset of the manifest, or the manifest itself if no services
are specified as "available".
ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java