jnosql
jnosql copied to clipboard
Add a ConfigurationProvider
This proposal covers one way to load a Configuration implementation using ServiceLoader. The Configuration project has three types:
- Column ConfigurationProvider
- Document ConfigurationProvider
- Key-Value ConfigurationProvider
Eg;
ColumnConfiguration<DriverA> configuration = ColumnConfigurationProvider.getConfiguration();
When the application has either when not ConfigurationProvider in the classloader or when more than one ConfigurationProvider will launch an exception. However, we must add a method to solve this ambiguous exception, when there is more than one ConfigurationProvider in the classloader.
Eg:
DriverConfiguration configuration = ColumnConfigurationProvider.getConfiguration(DriverConfiguration.class);
Happy to help with that given I worked a lot on the JSR 363 SPI using ServiceLoader, too.