ResourceInstance createHostComponentResource(String clusterName, String hostName, String hostComponentName) {
    Map<Resource.Type,String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.Cluster, clusterName);
    mapIds.put(Resource.Type.Host, hostName);
    mapIds.put(Resource.Type.HostComponent, hostComponentName);

    return createResource(Resource.Type.HostComponent, mapIds);
  }
Create a host_component resource instance.

@param clusterName       cluster name
@param hostName          host name
@param hostComponentName host_component name

@return a host resource instance
ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java