public Collection<Container> match(ModuleDescriptor moduleDescriptor,
			ModuleDeploymentProperties deploymentProperties, Iterable<Container> containers) {
		Assert.notNull(moduleDescriptor, "'moduleDescriptor' cannot be null.");
		Assert.notNull(deploymentProperties, "'deploymentProperties' cannot be null.");
		Assert.notNull(containers, "'containers' cannot be null.");
		logger.debug("Matching containers for module {}", moduleDescriptor);
		String criteria = deploymentProperties.getCriteria();
		List<Container> candidates = findAllContainersMatchingCriteria(containers, criteria);
		Collection<Container> filteredContainers = applyFilters(moduleDescriptor, candidates);
		List<Container> results = new ArrayList<Container>(filteredContainers);
		if (results.isEmpty() && StringUtils.hasText(criteria)) {
			logger.warn("No currently available containers match deployment criteria '{}' for module '{}'.", criteria,
					moduleDescriptor.getModuleName());
		}
		return distributeForRequestedCount(results, deploymentProperties.getCount());
	}
Matches the provided module against one of the candidate containers.

@param moduleDescriptor      the module to match against
@param deploymentProperties  deployment properties for the module; this provides
                             hints such as the number of containers and other
                             matching criteria
@param containers            iterable list of containers to match against

@return a collection of matched containers; collection is empty if no suitable containers are found
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/admin/deployment/ContainerMatcher.java