archaius icon indicating copy to clipboard operation
archaius copied to clipboard

Load properties for @ConfigurationSource on @Provides methods

Open elandau opened this issue 5 years ago • 0 comments

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.

elandau avatar Jun 27 '19 02:06 elandau