AbstractComponentManager.getServiceReference need not be synchronized
---------------------------------------------------------------------

                 Key: FELIX-1239
                 URL: https://issues.apache.org/jira/browse/FELIX-1239
             Project: Felix
          Issue Type: Improvement
          Components: Declarative Services (SCR)
    Affects Versions: scr-1.0.10
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger
             Fix For: scr-1.0.10


With the changes to redo the event machinery in the component managers, the 
AbstractComponentManager.getServiceReference method has been made synchronous. 
Since this method backs the ComponentContext.getServiceReference() such calls 
may be blocked while the AbstractComponentManager is changing state.

The getServiceReference method should therefore not be synchronized and need 
not be either: We make the service reference field of the 
AbstractComponentManager volatile and before calling the 
State.getServiceReference method we copy the current state to a local variable 
before calling the getServiceReference method. In addition, we will have to 
cope for the situation that the Service becomes unregistered while trying to 
get the ServiceReference, which may cause an IllegalStateException to be thrown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to