public synchronized void undeploy(ModuleDescriptor moduleDescriptor) {
		Introspector.flushCaches(); // This is to prevent classloader leakage
		String group = moduleDescriptor.getGroup();
		int index = moduleDescriptor.getIndex();
		Map<Integer, Module> modules = deployedModules.get(group);
		if (modules != null) {
			Module module = modules.remove(index);
			if (modules.isEmpty()) {
				deployedModules.remove(group);
			}
			if (module != null) {
				destroyModule(module);
			}
			else {
				logger.debug("Ignoring undeploy - module with index {} from group {} is not deployed", index, group);
			}
		}
		else {
			logger.trace("Ignoring undeploy - group not deployed here: {}", group);
		}
	}
Shut down the module indicated by {@code moduleDescriptor}
and remove its registration from the container. Lifecycle
plugins are applied during undeployment.

@param moduleDescriptor descriptor for module to be undeployed
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/module/ModuleDeployer.java