private void onChildAdded(CuratorFramework client, ChildData data) throws Exception {
		String path = data.getPath();
		ModuleDeploymentsPath moduleDeploymentsPath = new ModuleDeploymentsPath(path);
		String unitName = moduleDeploymentsPath.getDeploymentUnitName();
		String moduleType = moduleDeploymentsPath.getModuleType();
		String moduleLabel = moduleDeploymentsPath.getModuleLabel();
		int moduleSequence = moduleDeploymentsPath.getModuleSequence();
		ModuleDescriptor.Key key = new ModuleDescriptor.Key(unitName, ModuleType.valueOf(moduleType), moduleLabel);
		String container = moduleDeploymentsPath.getContainer();
		Module module = null;
		ModuleDeploymentStatus status;

		RuntimeModuleDeploymentProperties properties = new RuntimeModuleDeploymentProperties();
		properties.putAll(ZooKeeperUtils.bytesToMap(data.getData()));

		try {
			module = (ModuleType.job.toString().equals(moduleType)) ?
					deployJobModule(client, unitName, moduleLabel, properties) :
					deployStreamModule(client, unitName, moduleType, moduleLabel, properties);
			if (module == null) {
				status = new ModuleDeploymentStatus(container, moduleSequence, key, ModuleDeploymentStatus.State.failed,
						"Module deployment returned null");
			}
			else {
				status = new ModuleDeploymentStatus(container, moduleSequence, key,
						ModuleDeploymentStatus.State.deployed, null);
			}
		}
		catch (Exception e) {
			status = new ModuleDeploymentStatus(container, moduleSequence, key, ModuleDeploymentStatus.State.failed,
					ZooKeeperUtils.getStackTrace(e));
			logger.error("Exception deploying module", e);
		}

		try {
			writeModuleMetadata(client, module, path);
			client.setData().forPath(status.buildPath(), ZooKeeperUtils.mapToBytes(status.toMap()));
		}
		catch (KeeperException.NoNodeException e) {
			logger.warn("During deployment of module {} of type {} for {} with sequence number {}," +
							"an undeployment request was detected; this module will be undeployed.", moduleLabel,
					moduleType, unitName, moduleSequence);
			if (logger.isTraceEnabled()) {
				logger.trace("Path " + path + " was removed", e);
			}
		}
	}
Event handler for new module deployments.

@param client curator client
@param data module data
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/container/DeploymentListener.java