Jürgen Albert created FELIX-6589:
------------------------------------

             Summary: update method with constructor injection does not work
                 Key: FELIX-6589
                 URL: https://issues.apache.org/jira/browse/FELIX-6589
             Project: Felix
          Issue Type: Bug
          Components: Declarative Services (SCR)
    Affects Versions: scr-2.2.6
            Reporter: Jürgen Albert


I have a scenario, where I use constructor injection and on one of the 
references I get an update method is defined. When the properties of the 
registered service change the update method is never called however. 

When I move the Reference from the constructor to a usual bind method, or even 
with a duplicated on it works like a charm.  

The Constructor looks as follows:

{code:java}
        public DefaultResourceSetFactoryComponent(ComponentContext ctx,
                        @Reference(name="resourceFactoryRegistry", 
unbind="unsetResourceFactoryRegistry", updated = 
"modifiedResourceFactoryRegistry")
                        ServiceReference<Resource.Factory.Registry> 
resourceFactoryRegistryReference
                        ) {
{code}

The bind method that works looks as follows:
{code:java}
@Reference(policy=ReferencePolicy.STATIC, 
unbind="unsetResourceFactoryRegistry", updated = 
"modifiedResourceFactoryRegistry")
        public void setResourceFactoryRegistry(Resource.Factory.Registry 
resourceFactoryRegistry, Map<String, Object> properties) {
{code}

Both update methodes are mentioned correctly in the resulting component xml.

I also played around with ComponentServiceObjects, ServiceReference and the 
service itself. Result stays the same.

If the Spec says that this is the correct behavior that I can't fin the passage.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to