felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland <...@ids.de>
Subject Re: Why OSGI Configuration is bound to a admin bundle temporary?
Date Wed, 10 Jul 2013 08:24:09 GMT
I still do not know why that does not work, but I have a problem solution.

This code does not work...
    ConfigurationAdmin confAdmin =
getConfigurationAdminService(bundlecontext);
    if(confAdmin != null){
      try{
        configuration = confAdmin.getConfiguration(*pid*);
      }catch(IOException e){
         ...
      }
      if(configuration != null){
        return configuration.getProperties(); //returns null
      }
    }

Workaround...
    ConfigurationAdmin confAdmin =
getConfigurationAdminService(bundlecontext);
    if(confAdmin != null){
      Configuration[] configs = null;
      *String filter = "(service.pid=" + pid + *)";*
      try{
        configs = confAdmin.listConfigurations(filter);
      }catch(IOException e){
        ...
      }catch(InvalidSyntaxException e){
        ...
      }
      if(configs != null){
        for(Configuration conf : configs)
        {
          Dictionary<String, Object>properties = conf.getProperties();
          ...
        }
      }

Regards...
Roland



--
View this message in context: http://apache-felix.18485.x6.nabble.com/OSGI-Configuration-cannot-take-effect-immediately-tp4833849p5004265.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message