private void deployUnallocatedJobModules() throws Exception {
		List<ModuleDeploymentRequestsPath> requestedModulesPaths = getAllModuleDeploymentRequests();
		CuratorFramework client = getClient();
		// check for "orphaned" jobs that can be deployed to this new container
		for (ChildData data : jobDeployments.getCurrentData()) {
			String jobName = ZooKeeperUtils.stripPathConverter.convert(data);

			try {
				final Job job = DeploymentLoader.loadJob(client, jobName, jobFactory);
				// if job is null this means the job was destroyed or undeployed
				if (job != null) {
					List<ModuleDeploymentRequestsPath> requestedModules = ModuleDeploymentRequestsPath.getModulesForDeploymentUnit(
							requestedModulesPaths, jobName);
					Set<String> previouslyDeployed = new HashSet<String>();

					for (String deployedModule : client.getChildren().forPath(Paths.build(data.getPath(), Paths.MODULES))) {
						previouslyDeployed.add(Paths.stripPath(new JobDeploymentsPath(Paths.build(data.getPath(),
								Paths.MODULES,
								deployedModule)).getModuleInstanceAsString()));
					}

					for (ModuleDeploymentRequestsPath path : requestedModules) {
						ModuleDescriptor moduleDescriptor = job.getJobModuleDescriptor();
						if (shouldDeploy(moduleDescriptor, path, previouslyDeployed)) {
							RuntimeModuleDeploymentProperties moduleDeploymentProperties =
									new RuntimeModuleDeploymentProperties();
							moduleDeploymentProperties.putAll(ZooKeeperUtils.bytesToMap(
									moduleDeploymentRequests.getCurrentData(path.build()).getData()));
							redeployModule(new ModuleDeployment(job, moduleDescriptor,
									moduleDeploymentProperties), true);
						}
					}
				}
			}
			catch (Exception e) {
				logger.error(
						String.format("Exception while evaluating module status for job %s", jobName),
						e);
			}
		}
	}
Deploy any "unallocated" jobs (jobs that are supposed to be deployed but
do not have any modules deployed in any container).

@throws Exception
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/admin/deployment/zk/ContainerMatchingModuleRedeployer.java