karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: What's the recommended way of reading configuration?
Date Sun, 03 Dec 2017 10:41:25 GMT
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 type ConfigRepository[2]?
> 
> Or maybe avoid karaf dependencies, and get an OSGi service of type
> ConfigurationAdmin[3]...?
> 
> Does anyone know of code examples of any of the three approaches?
> Preferrably DS w/annotation based code examples?
> 
> 
> Thanks!
> 
> 
> - Steinar
> 
> References:
> [1] <https://github.com/apache/karaf/blob/master/config/src/main/java/org/apache/karaf/config/core/ConfigMBean.java>
> [2] <https://github.com/apache/karaf/blob/master/config/src/main/java/org/apache/karaf/config/core/ConfigRepository.java>
> [3] <https://osgi.org/javadoc/r4v42/org/osgi/service/cm/ConfigurationAdmin.html>
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Mime
View raw message