public static ResourceProvider getResourceProvider(Resource.Type type,
                                                     ClusterDefinition clusterDefinition) {
    if (type.equals(Resource.Type.Cluster)) {
      return new ClusterProvider(clusterDefinition);
    } else if (type.equals(Resource.Type.Service)) {
      return new ServiceProvider(clusterDefinition);
    } else if (type.equals(Resource.Type.Component)) {
      return new ComponentProvider(clusterDefinition);
    } else if (type.equals(Resource.Type.Host)) {
      return new HostProvider(clusterDefinition);
    } else if (type.equals(Resource.Type.HostComponent)) {
      return new HostComponentProvider(clusterDefinition);
    } else if (type.equals(Resource.Type.Request)) {
      return new RequestProvider(clusterDefinition);
    } else if (type.equals(Resource.Type.Task)) {
      return new TaskProvider(clusterDefinition);
    } else if (type.equals(Resource.Type.Configuration)) {
      return new ConfigurationProvider(clusterDefinition);
    } else {
      return new NoOpProvider(type, clusterDefinition);
    }
  }
Factory method for obtaining a resource provider based on a given type.

@param type               the resource type
@param clusterDefinition  the cluster definition

@return a new resource provider
contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/msi/AbstractResourceProvider.java