Hi Oli adding information also to my previous mail I try to provide you an example:
PropertyProvider cfg = PropertyProviders.fromPath(AggregationPolicy.EXCEPTION, "META-INF/cfg/*.xml", "META-INF/cfg/*.ini"); PropertyProvider messages = PropertyProviders.fromPath(AggregationPolicy.EXCEPTION, "META-INF/cfg/res/*.xml", "META-INF/cfg/res/*.properties"); PropertyProvider dbEntries = PropertyProviders.fromPath(AggregationPolicy.LOG_DUPLICATES, "jdbc:myCfgDatasource.dbformat1"); Configuration finalConfig = PropertyProviders.aggregate(AggregationPolicy.IGNORE_DUPLICATES, PropertyProviders.prefix(messages, "msg."), dbEntries, cfg).toConfiguration(); In this case we support different config formats in both cases (sub providers)... Does that help? -----Original Message----- From: Oliver B. Fischer [mailto:[email protected]] Sent: Mittwoch, 3. Dezember 2014 08:37 To: [email protected] Subject: Re: Use Case 1: Read simple properties and get values. So if a new ConfigFormat is required for reading a different data source: What is the difference between ConfigFormat and PropertyProvider? Isn't it the same? IMHO we have to discuss the overall architecture a least a little bit to see which parts exist, how they interact and who is responsible for what. Oliver Am 03.12.14 01:15, schrieb Anatole Tresch: > BTW, supporting a new ConfigFormat is trivial: implementing > ConfigurationFormat > and register it with as component, by default using the ServiceLoader. > Then you only to read the file and you are done ;) > > 2014-12-01 19:48 GMT+01:00 Gerhard Petracek <[email protected]>: > > -- N Oliver B. Fischer A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany P +49 30 44793251 M +49 178 7903538 E [email protected] S oliver.b.fischer J [email protected] X http://xing.to/obf
