private void onChildRemoved(CuratorFramework client, ChildData data) throws Exception {
		ModuleDeploymentsPath moduleDeploymentsPath = new ModuleDeploymentsPath(data.getPath());
		String streamName = moduleDeploymentsPath.getDeploymentUnitName();
		String moduleType = moduleDeploymentsPath.getModuleType();
		String moduleLabel = moduleDeploymentsPath.getModuleLabel();
		String moduleSequence = moduleDeploymentsPath.getModuleSequenceAsString();

		undeployModule(streamName, moduleType, moduleLabel);

		String path;
		if (ModuleType.job.toString().equals(moduleType)) {
			path = new JobDeploymentsPath().setJobName(streamName).setModuleLabel(moduleLabel)
					.setContainer(containerAttributes.getId()).build();
		}
		else {
			path = new StreamDeploymentsPath().setStreamName(streamName).setModuleType(moduleType)
					.setModuleLabel(moduleLabel).setModuleSequence(moduleSequence)
					.setContainer(this.containerAttributes.getId()).build();
		}
		if (client.checkExists().forPath(path) != null) {
			logger.trace("Deleting path: {}", path);
			client.delete().forPath(path);
		}
	}
Event handler for deployment removals.

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