Re: What's the recommended way of reading configuration?

2017-12-03 Thread Timothy Ward
> I didn’t mean ManagedService using DS, I meant using DS configuration (which > is basically a managed service. Ok - but you can see the source of confusion right? Your post does not reference DS at all, and ManagedService is an interface defined by ConfigurationAdmin. If someone looks up

Re: What's the recommended way of reading configuration?

2017-12-03 Thread Steinar Bang
> Timothy Ward : > None of the above. When it comes to configuration you should always be > using Configuration Admin to inject you, not getting a service. If > you’re using DS then this configuration can be directly injected into > your activate method, either as a Map

Re: What's the recommended way of reading configuration?

2017-12-03 Thread Jean-Baptiste Onofré
I didn't mean ManagedService using DS, I meant using DS configuration (which is basically a managed service. When using @Component, we implicitly have a configuration link to the component injected via activate and the ComponentContext (getProperties). I disagree about @Referece to

Re: What's the recommended way of reading configuration?

2017-12-03 Thread Timothy Ward
> I would more recommend a ManagedService or inject the ConfigAdmin service. This is really bad advice, and Steinar should definitely not do either of these things (nor should other readers of this mail chain). Steinar has already indicated that he wants to use Declarative Services, so

Re: What's the recommended way of reading configuration?

2017-12-03 Thread Jean-Baptiste Onofré
I would more recommend a ManagedService or inject the ConfigAdmin service. Regards JB On 12/03/2017 09:41 AM, Steinar Bang wrote: What's the recommended way for an OSGi bundle running inside karaf to access its configuration? Get an OSGi service of type ConfigMBean[1]? Get an OSGi servie of

Re: What's the recommended way of reading configuration?

2017-12-03 Thread Timothy Ward
Hi Steinar, > What's the recommended way for an OSGi bundle running inside karaf to > access its configuration? > > Get an OSGi service of type ConfigMBean[1]? > Get an OSGi servie of type ConfigRepository[2]? > > Or maybe avoid karaf dependencies, and get an OSGi service of type >

Re: What's the recommended way of reading configuration?

2017-12-03 Thread Steinar Bang
> Steinar Bang : > What's the recommended way for an OSGi bundle running inside karaf to > access its configuration? To be more specific: I'm looking for the best and simplest way to retrieve the configuration that in a plain Java application typically would be put in

What's the recommended way of reading configuration?

2017-12-03 Thread Steinar Bang
What's the recommended way for an OSGi bundle running inside karaf to access its configuration? Get an OSGi service of type ConfigMBean[1]? Get an OSGi servie of type ConfigRepository[2]? Or maybe avoid karaf dependencies, and get an OSGi service of type ConfigurationAdmin[3]...? Does anyone