private Environment lookupEnvironment(ModuleDefinition moduleDefinition) {
		// load rootEnvironment at runtime than during the startup
		rootEnvironment = loadPropertySources(xdModuleConfigLocation, configName);
		String propertySourceName = String.format("%s:%s",
				moduleDefinition.getType(), moduleDefinition.getName());
		// Load short name values into a throwaway env
		String path = String.format("%s%s/%s/", xdModuleConfigLocation, moduleDefinition.getType(),
				moduleDefinition.getName());
		ConfigurableEnvironment throwAwayEnvironment = loadPropertySources(path, moduleDefinition.getName());
		EnumerablePropertySource<?> nakedPS = (EnumerablePropertySource<?>) throwAwayEnvironment.getPropertySources().get(
				APPLICATION_CONFIGURATION_PROPERTIES);
		// Now transform them to their fully qualified form
		Map<String, Object> values = new HashMap<String, Object>();
		for (String name : nakedPS.getPropertyNames()) {
			values.put(fullyQualifiedKey(moduleDefinition, name), nakedPS.getProperty(name));
		}
		EnumerablePropertySource<?> modulePS = new MapPropertySource(propertySourceName, values);
		ConfigurableEnvironment moduleEnvironment = new StandardEnvironment();
		// Append the rootEnvironment
		moduleEnvironment.merge(rootEnvironment);
		// The global environment has been loaded by boot too and
		// its PS of interest was also named "applicationConfigurationProperties"
		moduleEnvironment.getPropertySources().addBefore(APPLICATION_CONFIGURATION_PROPERTIES, modulePS);
		return moduleEnvironment;
	}
The parent environment this bean lives in. Used to know which profiles are active at the server level.
spring-xd-module/src/main/java/org/springframework/xd/module/options/EnvironmentAwareModuleOptionsMetadataResolver.java