private static boolean isExtensionService(StackInfo stack, String serviceName, String extensionName) {
    ExtensionInfo extension = stack.getExtension(extensionName);
    if (extension == null) {
      LOG.debug("Extension not found " + extensionName);
      return false;
    }

    return extension.getService(serviceName) != null;
  }
An extension version is like a stack version but it contains custom services.  Linking an extension
version to the current stack version allows the cluster to install the custom services contained in
the extension version.
ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionHelper.java