Question

So, I have springDM managed properties

<beans:beans xmlns="http://www.springframework.org/schema/osgi-compendium"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
xsi:schemaLocation="
  http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/osgi-compendium 
    http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">

<beans:bean id="configurationBean" class="com.eugene.PropertiesBean">
    <osgix:managed-properties persistent-id="MyPid" update-strategy="container-managed"/>
    <beans:property name="host" value="localhost"></beans:property>
    <beans:property name="port" value="5698"></beans:property>
</beans:bean>
</beans:beans>

Now, here is what I do. Deploy the bundle to Virgo, everything works great, the default properties (because the MyPid.properties is not deployed) get injected into the bean.

Deploy MyPid.properties where BOTH host and port are changed, they are both re-injected also.

That's great. But here is the thing, can I have one single method that would tell me that the bean has changed? The properties have been re-injected? Something like : afterPropertiesSet or init in XML config? Because right now having an afterPropertiesSet or init works only the first time the properties get injected, not the second, third and so on... Which is somehow logic.

I do not know (googleed it) if spring DM offers such a thing.

Thx! Eugene.

Was it helpful?

Solution

This is a known issue actually. We had to switch to bean-managed updates.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top