1 | package fr.sii.ogham.spring.common; | |
2 | ||
3 | import java.util.Properties; | |
4 | ||
5 | import org.slf4j.Logger; | |
6 | import org.slf4j.LoggerFactory; | |
7 | import org.springframework.core.env.Environment; | |
8 | ||
9 | import fr.sii.ogham.core.CoreConstants; | |
10 | import fr.sii.ogham.core.builder.configurer.MessagingConfigurerAdapter; | |
11 | import fr.sii.ogham.core.builder.env.EnvironmentBuilder; | |
12 | import fr.sii.ogham.spring.env.SpringEnvironmentPropertyResolver; | |
13 | ||
14 | /** | |
15 | * Configures general environment (and may be inherited) to use Spring | |
16 | * {@link Environment} instead of basic Java {@link Properties} object. | |
17 | * | |
18 | * @author Aurélien Baudet | |
19 | * | |
20 | */ | |
21 | public class SpringEnvironmentConfigurer extends MessagingConfigurerAdapter implements SpringMessagingConfigurer { | |
22 | private static final Logger LOG = LoggerFactory.getLogger(SpringEnvironmentConfigurer.class); | |
23 | | |
24 | private final Environment environment; | |
25 | ||
26 | public SpringEnvironmentConfigurer(Environment environment) { | |
27 | super(); | |
28 | this.environment = environment; | |
29 | } | |
30 | ||
31 | @Override | |
32 | public void configure(EnvironmentBuilder<?> environmentBuilder) { | |
33 | LOG.debug("[{}] apply configuration", this); | |
34 | environmentBuilder.resolver(new SpringEnvironmentPropertyResolver(environment)); | |
35 | } | |
36 | ||
37 | @Override | |
38 | public int getOrder() { | |
39 |
1
1. getOrder : replaced int return with 0 for fr/sii/ogham/spring/common/SpringEnvironmentConfigurer::getOrder → SURVIVED |
return CoreConstants.DEFAULT_MESSAGING_CONFIGURER_PRIORITY - 1000; |
40 | } | |
41 | ||
42 | } | |
Mutations | ||
39 |
1.1 |