public boolean isServiceSupported(String serviceName, String stackName, String stackVersion) {
    try {
      ServiceInfo service = metaInfo.get().getServices(stackName, stackVersion).get(serviceName);
      return service != null && !service.isDeleted();
    } catch (AmbariException e) {
      throw new RuntimeException(e);
    }
  }
Checks if the service is supported by the stack using metainfo
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentSupport.java