You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2009/06/15 12:53:07 UTC

[jira] Closed: (FELIX-1239) AbstractComponentManager.getServiceReference need not be synchronized

     [ https://issues.apache.org/jira/browse/FELIX-1239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger closed FELIX-1239.
------------------------------------

    Resolution: Fixed

Implemented this change as described in Rev. 784722

> 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.