H João;

I have asked the same question, and you can refer to the following post:
  http://www.mail-archive.com/[email protected]/msg01120.html

FYI, at Alcatel-Lucent, we don't use conf admin, especially because it
sounds like it is not possible to
easily reconfigure SCR componenst without restarting them (and we think,
like you, that it is an issue).

We tried the same thing than you, by using a service.pid different from
the component name, but our "updated"
method was called twice, like in your case.

So, we work around like this: we have our own configuration manager
(which could use configadmin, but does not for now).
And our config manager injects standard java.util.Properties objects
into the OSGi service registry.
So, our configurable SCR components just define references over
Properties object, using a "config.id" keyword:

For example, in the OSGi service registry, our conf manager registers a
Properties object with "config.id=MyEnglishDictionary",
and here is the SCR.xml for our EnlishDictionary component:

<component name="EnglishDictionary">
 <implementation class="sample.impl.dictionary.english.EnglishDictionary"/>

 <reference name="Config" interface="java.util.Properties"
   bind="bindConfig"
   target="(config.id=MyEnglishDictionary)"
   policy="dynamic"
   cardinality="1..n"/>

 <service>
   <provide interface="sample.service.dictionary.Dictionary"/>
 </service>
 <property name="language" value="en"/>
</component>

And when the conf manager updates the Properties in the OSGi service
registry, then the EnglishDictionary component is just invoked
in the bindConfi() method, without being reactivated (notice the
policy="dynamic" attribute).

If someone has a better approach ... I am very interested ...

Hope this helps you.
/pierre

João Assunção wrote:
Hello,

Is it possible to update the configuration of a declarative service without
the reactivation?
I make this question because it seems the reactivation implies deleting the
service and creating a new one, something that is very inconvenient to me.
As a workaround, I declared in the component configuration a property named
service.pid with a value different from the component name and added the
entry <provide interface="org.osgi.service.cm.ManagedService" />.  This
seems to work, (apart the duplicate invocation of the update method when the
bundle starts), but I'm worried this might cause problems.

Thank you.

Joao




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to