Skip to content

Conversation

@elandau
Copy link
Contributor

@elandau elandau commented Jun 27, 2019

Loading configuration with @provides methods currently requires a hack to inject a second type that is annotated with @ConfigurationSource. This change makes it possible to annotate the @provides method with @ConfigurationSource to have the configuration loaded before the bean is provisioned. For example,

@ConfigurationSource({"foo"})
@Provides
@Singleton
Foo getFoo() {
}

will result in foo.properties (and it's variants) being loaded before getFoo is called.

Loading configuration with @provides methods currently requires a hack to inject a second type that is annotated with @ConfigurationSource.  This change makes it possible to annotate the @provides with with @ConfigurationSource to have the configuration loaded before the bean is provisioned.  For example,

```
@ConfigurationSource({"foo"})
@provides
@singleton
Foo getFoo() {
}
```
will result in foo.properties (and it's variants) being loaded before getFoo is called.
@elandau elandau force-pushed the feature/at_provides_configuration_source branch from ef7444e to b923dcd Compare June 27, 2019 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants