@Override
	public void onApplicationEvent(ApplicationPreparedEvent event) {
		if (this.decryptor == null) {
			return;
		}

		ConfigurableApplicationContext applicationContext = event
				.getApplicationContext();
		if (!applicationContext.equals(this.applicationContext)){
			return;
		}

		/*
		 * register the decryptor as a bean so it is available to the
		 * PropertiesDecryptorPlugin later.
		 */
		if (!applicationContext.containsBean(DECRYPTOR_BEAN_NAME)) {
			applicationContext.getBeanFactory().registerSingleton
					(DECRYPTOR_BEAN_NAME, decryptor);
		}
		ConfigurableEnvironment environment = applicationContext.getEnvironment();

		MutablePropertySources propertySources = environment.getPropertySources();

		Map<String, Object> map = decrypt(propertySources);
		if (!map.isEmpty()) {
			insert(propertySources,
					new MapPropertySource(DECRYPTED_PROPERTY_SOURCE_NAME, map));
		}
	}
Strategy to determine how to handle exceptions during decryption.

@param failOnError the flag value (default true)
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/container/decryptor/PropertiesDecryptor.java