archaius
archaius copied to clipboard
Load properties for @ConfigurationSource on @Provides methods
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.