Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
d2685728
Commit
d2685728
authored
Jun 28, 2017
by
satamas
Committed by
Stephane Nicoll
Jun 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Narrow the event types ConfigFileApplicationListener supports
See gh-9628
parent
eb299b95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
ConfigFileApplicationListener.java
...rk/boot/context/config/ConfigFileApplicationListener.java
+14
-2
No files found.
spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java
View file @
d2685728
...
...
@@ -46,9 +46,9 @@ import org.springframework.boot.env.EnvironmentPostProcessor;
import
org.springframework.boot.env.PropertySourcesLoader
;
import
org.springframework.boot.logging.DeferredLog
;
import
org.springframework.context.ApplicationEvent
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ConfigurationClassPostProcessor
;
import
org.springframework.context.event.SmartApplicationListener
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.AnnotationAwareOrderComparator
;
import
org.springframework.core.convert.ConversionService
;
...
...
@@ -62,6 +62,7 @@ import org.springframework.core.io.DefaultResourceLoader;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.ResourceLoader
;
import
org.springframework.core.io.support.SpringFactoriesLoader
;
import
org.springframework.lang.Nullable
;
import
org.springframework.util.Assert
;
import
org.springframework.util.ResourceUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -102,7 +103,7 @@ import org.springframework.validation.BindException;
* @author Eddú Meléndez
*/
public
class
ConfigFileApplicationListener
implements
EnvironmentPostProcessor
,
ApplicationListener
<
ApplicationEvent
>
,
Ordered
{
SmartApplicationListener
,
Ordered
{
private
static
final
String
DEFAULT_PROPERTIES
=
"defaultProperties"
;
...
...
@@ -276,6 +277,17 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
this
.
names
=
names
;
}
@Override
public
boolean
supportsEventType
(
Class
<?
extends
ApplicationEvent
>
eventType
)
{
return
ApplicationEnvironmentPreparedEvent
.
class
.
isAssignableFrom
(
eventType
)
||
ApplicationPreparedEvent
.
class
.
isAssignableFrom
(
eventType
);
}
@Override
public
boolean
supportsSourceType
(
@Nullable
Class
<?>
aClass
)
{
return
true
;
}
/**
* {@link BeanFactoryPostProcessor} to re-order our property sources below any
* {@code @PropertySource} items added by the {@link ConfigurationClassPostProcessor}.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment