org.springframework.cloud.bootstrap.BootstrapApplicationListener Java Examples

The following examples show how to use org.springframework.cloud.bootstrap.BootstrapApplicationListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EnvironmentDecryptApplicationInitializer.java    From spring-cloud-commons with Apache License 2.0 6 votes vote down vote up
private void insert(MutablePropertySources propertySources,
		PropertySource<?> propertySource) {
	if (propertySources
			.contains(BootstrapApplicationListener.BOOTSTRAP_PROPERTY_SOURCE_NAME)) {
		if (DECRYPTED_BOOTSTRAP_PROPERTY_SOURCE_NAME
				.equals(propertySource.getName())) {
			propertySources.addBefore(
					BootstrapApplicationListener.BOOTSTRAP_PROPERTY_SOURCE_NAME,
					propertySource);
		}
		else {
			propertySources.addAfter(
					BootstrapApplicationListener.BOOTSTRAP_PROPERTY_SOURCE_NAME,
					propertySource);
		}
	}
	else {
		propertySources.addFirst(propertySource);
	}
}
 
Example #2
Source File: BootstrappingJasyptConfigurationTest.java    From jasypt-spring-boot with MIT License 5 votes vote down vote up
@Override
public int getOrder() {
	// order should be greater than
	// BootstrapApplicationListener.DEFAULT_ORDER - so that this
	// listener is invoked after BootstrapApplicationListener, otherwise
	// bootstrap.properties will not have been read. This is required
	// since encrypted text (i.e.
	// passwords) could be configured in bootstrap.properties.
	return BootstrapApplicationListener.DEFAULT_ORDER + 1;
}