@Override
	public boolean registerNew(ModuleDefinition definition) {
		if (!definition.isComposed()) {
			return false;
		}
		String path = Paths.build(Paths.MODULES, definition.getType().toString(),
				definition.getName());
		byte[] data = null;
		try {

			// Save actual definition
			data = objectMapper.writeValueAsString(definition).getBytes("UTF-8");
			zooKeeperConnection.getClient().create().creatingParentsIfNeeded().forPath(path, data);

			// Also track dependencies
			List<ModuleDefinition> childrenDefinitions = ((CompositeModuleDefinition) definition).getChildren();
			for (ModuleDefinition child : childrenDefinitions) {
				ModuleDefinitionRepositoryUtils.saveDependencies(moduleDependencyRepository, child,
						dependencyKey(definition));
			}
		}
		catch (KeeperException.NodeExistsException fallback) {
			try {
				zooKeeperConnection.getClient().setData().forPath(path, data);
			}
			catch (Exception e) {
				throw ZooKeeperUtils.wrapThrowable(e);
			}
		}
		catch (Exception e) {
			throw ZooKeeperUtils.wrapThrowable(e);
		}
		return true;
	}
A reference to the main module registry (which also typically contains this registry as a delegate),
used to re-hydrate {@link org.springframework.xd.module.SimpleModuleDefinition}s with locations that
make sense on this runtime(admin or container).
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/module/store/ZooKeeperComposedModuleDefinitionRegistry.java