@Override
	public void afterPropertiesSet() throws Exception {
		Matcher matcher = NO_SYNCHRONIZATION_PATTERN.matcher(root);
		if (matcher.matches()) {
			registry = new WritableResourceModuleRegistry(root);
			((WritableResourceModuleRegistry)registry).setRequireHashFiles(requiresHashFiles);
			((WritableResourceModuleRegistry)registry).afterPropertiesSet();
			logger.info("Custom modules will be written directly to {}", root);
		}
		else {
			String localRoot = "file:" + Files.createTempDirectory("spring-xd-custom-modules");
			WritableResourceModuleRegistry local = new WritableResourceModuleRegistry(localRoot);
			local.afterPropertiesSet();

			WritableResourceModuleRegistry remote = new WritableResourceModuleRegistry(root);
			remote.setEnvironment(environment);
			remote.afterPropertiesSet();

			registry = new SynchronizingModuleRegistry(remote, local);
			logger.info("Custom modules will be written at {} and kept in synch locally at {}", root, localRoot);
		}
	}
Will create a {@link SynchronizingModuleRegistry} for hosting custom modules if necessary, depending on the
protocol scheme (using a synchronizing registry for everything but {@code file://} protocol).

@since 1.2
@author Eric Bottard
@author David Turanski
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/module/CustomModuleRegistryFactoryBean.java