"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastServerConfiguration.java" between
spring-boot-2.7.3.tar.gz and spring-boot-2.7.4.tar.gz

About: Spring Boot helps to create Spring-powered, production-grade applications and services.

HazelcastServerConfiguration.java  (spring-boot-2.7.3):HazelcastServerConfiguration.java  (spring-boot-2.7.4)
skipping to change at line 55 skipping to change at line 55
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Vedran Pavic * @author Vedran Pavic
*/ */
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@ConditionalOnMissingBean(HazelcastInstance.class) @ConditionalOnMissingBean(HazelcastInstance.class)
class HazelcastServerConfiguration { class HazelcastServerConfiguration {
static final String CONFIG_SYSTEM_PROPERTY = "hazelcast.config"; static final String CONFIG_SYSTEM_PROPERTY = "hazelcast.config";
static final String HAZELCAST_LOGGING_TYPE = "hazelcast.logging.type";
private static HazelcastInstance getHazelcastInstance(Config config) { private static HazelcastInstance getHazelcastInstance(Config config) {
if (StringUtils.hasText(config.getInstanceName())) { if (StringUtils.hasText(config.getInstanceName())) {
return Hazelcast.getOrCreateHazelcastInstance(config); return Hazelcast.getOrCreateHazelcastInstance(config);
} }
return Hazelcast.newHazelcastInstance(config); return Hazelcast.newHazelcastInstance(config);
} }
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@ConditionalOnMissingBean(Config.class) @ConditionalOnMissingBean(Config.class)
@Conditional(ConfigAvailableCondition.class) @Conditional(ConfigAvailableCondition.class)
skipping to change at line 91 skipping to change at line 93
config.setConfigurationFile(configLocation.getFil e()); config.setConfigurationFile(configLocation.getFil e());
} }
else { else {
config.setConfigurationUrl(configUrl); config.setConfigurationUrl(configUrl);
} }
return config; return config;
} }
private static Config loadConfig(URL configUrl) throws IOExceptio n { private static Config loadConfig(URL configUrl) throws IOExceptio n {
String configFileName = configUrl.getPath(); String configFileName = configUrl.getPath();
if (configFileName.endsWith(".yaml")) { if (configFileName.endsWith(".yaml") || configFileName.en dsWith(".yml")) {
return new YamlConfigBuilder(configUrl).build(); return new YamlConfigBuilder(configUrl).build();
} }
return new XmlConfigBuilder(configUrl).build(); return new XmlConfigBuilder(configUrl).build();
} }
} }
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@ConditionalOnSingleCandidate(Config.class) @ConditionalOnSingleCandidate(Config.class)
static class HazelcastServerConfigConfiguration { static class HazelcastServerConfigConfiguration {
skipping to change at line 126 skipping to change at line 128
HazelcastConfigCustomizer springManagedContextHazelcastConfigCust omizer(ApplicationContext applicationContext) { HazelcastConfigCustomizer springManagedContextHazelcastConfigCust omizer(ApplicationContext applicationContext) {
return (config) -> { return (config) -> {
SpringManagedContext managementContext = new Spri ngManagedContext(); SpringManagedContext managementContext = new Spri ngManagedContext();
managementContext.setApplicationContext(applicati onContext); managementContext.setApplicationContext(applicati onContext);
config.setManagedContext(managementContext); config.setManagedContext(managementContext);
}; };
} }
} }
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(org.slf4j.Logger.class)
static class HazelcastLoggingConfigCustomizerConfiguration {
@Bean
@Order(0)
HazelcastConfigCustomizer loggingHazelcastConfigCustomizer() {
return (config) -> {
if (!config.getProperties().containsKey(HAZELCAST
_LOGGING_TYPE)) {
config.setProperty(HAZELCAST_LOGGING_TYPE
, "slf4j");
}
};
}
}
/** /**
* {@link HazelcastConfigResourceCondition} that checks if the * {@link HazelcastConfigResourceCondition} that checks if the
* {@code spring.hazelcast.config} configuration key is defined. * {@code spring.hazelcast.config} configuration key is defined.
*/ */
static class ConfigAvailableCondition extends HazelcastConfigResourceCond ition { static class ConfigAvailableCondition extends HazelcastConfigResourceCond ition {
ConfigAvailableCondition() { ConfigAvailableCondition() {
super(CONFIG_SYSTEM_PROPERTY, "file:./hazelcast.xml", "cl asspath:/hazelcast.xml", "file:./hazelcast.yaml", super(CONFIG_SYSTEM_PROPERTY, "file:./hazelcast.xml", "cl asspath:/hazelcast.xml", "file:./hazelcast.yaml",
"classpath:/hazelcast.yaml"); "classpath:/hazelcast.yaml", "file:./haze lcast.yml", "classpath:/hazelcast.yml");
} }
} }
} }
 End of changes. 4 change blocks. 
2 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)