As in my answer here , you implement the interface the ConfigurationSourceProvider
way you want to implement, and configure the dropwizard application to use it in its Application class:
@Override
public void initialize(Bootstrap<MyConfiguration> bootstrap){
bootstrap.setConfigurationSourceProvider(new MyDatabaseConfigurationSourceProvider());
}
InputStream
YAML Configuration
.
bootstrap.setConfigurationFactoryFactory(new MyDatabaseConfigurationFactoryFactory<>());
FactoryFactory
:), Factory
, InputStream
Configuration
.
public T build(ConfigurationSourceProvider provider, String path {
Decode.onWhateverFormatYouWish(provider.open(path));
}