I would keep the update strategy reload. As far as I know it is the only
way to keep up to date with config changes.
Christian
Am 29.10.2013 13:45, schrieb lb:
reload is something left from copy-and-past :-)
thx for the hint.
—
lb
On Tue, Oct 29, 2013 at 1:12 PM, Christian Schneider
<[email protected] <mailto:[email protected]>> wrote:
On 29.10.2013 11:59, lbu wrote:
> Hi,
> I'm trying to figure-out which is the best option to configure a
bean
> instantiated via OSGi Blueprint and I have a some question for
which I
> haven't found the answer:
>
> 1) is there any way to reference to the cm:property-placeholder's
> persistent-id? So I can write something like:
>
> <cm:property-placeholder persistent-id="my.service.pid"
> update-strategy="reload">
> </cm:property-placeholder>
>
> <bean id="my.bean.id" class="my.bean.Class">
> <property name="servicePid" value="${persistent-id}"/>
> </bean>
The persistent id is reflected as property ${service.pid}
> 2) is there any way to have the ConfigAdmin to call
Class.update(Map ...)
> when the bean is instantiated?
>
> <cm:property-placeholder persistent-id="my.service.pid"
> update-strategy="reload">
> </cm:property-placeholder>
>
> <bean id="my.bean.id" class="my.bean.Class">
> </bean>
>
> class my.bean.Class {
> public void update(Map configuration) {
> ....
> }
> }
>
> thx - Luca
Reload means that the whole context is reloaded when the config
changes.
So it is not really an update but you can inject the whole map.
<cm:property-placeholder id="myConfig" persistent-id="my.service.pid"
update-strategy="reload">
</cm:property-placeholder>
<bean id="my.bean.id" class="my.bean.Class">
<property name="config" ref="myConfig"/>
</bean>
Christian
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
Talend Application Integration Division http://www.talend.com