Hi David, I asked myself the same kind of question, when implementing FELIX-3700, and I do agree with you: unless I have missed something from the spec, it is also not clear for me about what to do when configuration is updated from CA regarding existing instances created using ComponentFactory.
At the time I worked on FELIX-3700, I checked Eclipse DS, and it seems that, when configuration is updated from CA, then Eclipse DS does not update component instances created by ComponentFactory.newInstances() (same behavior than current Felix DS). But I tend to think like you that existing component instances should be updated, but only if they do have a @Modified method ... Another point: I also think that it would be extremely useful if we could update an existing component instance using a ComponentInstance.updateInstance(Dictionary) method. Maybe we could propose a spec enhancement about this (or someone already did this ?, I did not check) and also try to implement it ? But this is a different story ... kind regards; /Pierre On Mon, Mar 18, 2013 at 9:18 PM, David Jencks <[email protected]>wrote: > I've been writing some tests to verify what happens when you update > component configurations (from ca) that specify reference targets and I'm > unsure what should happen for factory components. > > It seems pretty clear from the spec that you can have a factory component > with configuration-policy="require" and that at least the initial > configuration properties for the factory come from config admin + xml > defaults and these properties get combined with the ones you specify in > factory.newInstance(props). > > So what happens when you update the config in ca? > > Right now just the factory gets configuration props updated, but all > existing components are unmodified. > > I think this is wrong and all the existing components should also have the > config update applied. > > Is there any language in the spec I missed? Any opinions or comments? > > 112.5.5 ends with this: > > Once a component configuration created by the Component Factory has been > deactivated, that com- ponent configuration will not be reactivated or used > again. > > which might suggest that static references won't work with this kind of > update or that what I think should happen is wrong. But this seems kinda > silly if the component is registered as a service. > > > many thanks > david jencks > >
