Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
scr-1.2.0
-
None
Description
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.