@Override
	public void initialize() {
		this.application.initializers(new ContextIdApplicationContextInitializer(this.toString()));
		ConfigurableEnvironment parentEnvironment = parent == null ? null
				: parent.getEnvironment();
		ModuleEnvironment environment = new ModuleEnvironment(moduleOptions.asPropertySource(), parentEnvironment);
		for (PropertySource<?> source : propertySources) {
			environment.getPropertySources().addFirst(source);
		}
		this.application.parent(parent);
		this.application.environment(environment);
		if (this.listeners.size() > 0) {
			application.listeners(this.listeners.toArray(new ApplicationListener<?>[this.listeners.size()]));
		}
		this.application.listeners(new ModuleParentContextCloserApplicationListener(getDescriptor().getIndex()));

		if (this.classLoader != null) {

			final ClassLoader defaultClassLoader = Thread.currentThread().getContextClassLoader();

			try {
				Thread.currentThread().setContextClassLoader(this.classLoader);
				this.context = this.application.run();
			}
			finally {
				Thread.currentThread().setContextClassLoader(defaultClassLoader);
			}
		}
		else {
			this.context = this.application.run();
		}

		if (logger.isInfoEnabled()) {
			logger.info("initialized module: " + this.toString());
		}
	}
Initialize this module by creating its application context, and provide it with a special
{@link org.springframework.core.env.Environment} that knows how to resolve module options placeholders.
spring-xd-module/src/main/java/org/springframework/xd/module/core/SimpleModule.java