Custom Loader (example : from a Database)
Closed this issue · 3 comments
glakshmeepathi commented
The only way I know of is to do a public class DBLoader implements Loader
and
@Config.Sources({
"db:",
"classpath:config/common/application.properties"
})
public boolean accept(URI uri) {
try {
return uri.getScheme().equals("db") ;
} catch (Exception ex) {
return false;
}
}
@Override
public void load(Properties result, URI uri) throws IOException {
result.putAll(ApplicationConfigurationFlatKVFromDB.getOverriddenAppPros());
}
There is no way to include a new Loader.
So I had to have the entire source.
Is there any way already available for such requirement ?
lviggiano commented
There is no way to include a new Loader.
glakshmeepathi commented
My bad. Thank you. Let me check. Hope whatever loader is registered last has the highest priority ?
lviggiano commented
@glakshmeepathi Yes, it should be like that.