|
46 | 46 | import org.springframework.boot.env.PropertySourcesLoader;
|
47 | 47 | import org.springframework.boot.logging.DeferredLog;
|
48 | 48 | import org.springframework.context.ApplicationEvent;
|
49 |
| -import org.springframework.context.ApplicationListener; |
50 | 49 | import org.springframework.context.ConfigurableApplicationContext;
|
51 | 50 | import org.springframework.context.annotation.ConfigurationClassPostProcessor;
|
| 51 | +import org.springframework.context.event.SmartApplicationListener; |
52 | 52 | import org.springframework.core.Ordered;
|
53 | 53 | import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
54 | 54 | import org.springframework.core.convert.ConversionService;
|
|
102 | 102 | * @author Eddú Meléndez
|
103 | 103 | */
|
104 | 104 | public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
|
105 |
| - ApplicationListener<ApplicationEvent>, Ordered { |
| 105 | + SmartApplicationListener, Ordered { |
106 | 106 |
|
107 | 107 | private static final String DEFAULT_PROPERTIES = "defaultProperties";
|
108 | 108 |
|
@@ -151,6 +151,17 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
|
151 | 151 |
|
152 | 152 | private final ConversionService conversionService = new DefaultConversionService();
|
153 | 153 |
|
| 154 | + @Override |
| 155 | + public boolean supportsEventType(Class<? extends ApplicationEvent> eventType) { |
| 156 | + return ApplicationEnvironmentPreparedEvent.class.isAssignableFrom(eventType) || |
| 157 | + ApplicationPreparedEvent.class.isAssignableFrom(eventType); |
| 158 | + } |
| 159 | + |
| 160 | + @Override |
| 161 | + public boolean supportsSourceType(Class<?> aClass) { |
| 162 | + return true; |
| 163 | + } |
| 164 | + |
154 | 165 | @Override
|
155 | 166 | public void onApplicationEvent(ApplicationEvent event) {
|
156 | 167 | if (event instanceof ApplicationEnvironmentPreparedEvent) {
|
|
0 commit comments