[
https://issues.apache.org/jira/browse/FELIX-6050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16762189#comment-16762189
]
ASF GitHub Bot commented on FELIX-6050:
---------------------------------------
GitHub user tjwatson opened a pull request:
https://github.com/apache/felix/pull/182
FELIX-6050 - remove SinglePrototypeRefPair
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tjwatson/felix FELIX-6050
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/felix/pull/182.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #182
----
commit 1d2a62c36a7bb5ce8cf538447fcbe9d85265c343
Author: Tom Watson <tjwatson@...>
Date: 2019-02-06T21:13:33Z
FELIX-6050 - remove SinglePrototypeRefPair
----
> Get rid of SinglePrototypeRefPair
> ---------------------------------
>
> Key: FELIX-6050
> URL: https://issues.apache.org/jira/browse/FELIX-6050
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services (SCR)
> Affects Versions: scr-2.1.14
> Reporter: Thomas Watson
> Assignee: Thomas Watson
> Priority: Minor
>
> The SCR implementation has two classes that keep track of prototype
> references from a service component:
> org.apache.felix.scr.impl.manager.MultiplePrototypeRefPair
> org.apache.felix.scr.impl.manager.SinglePrototypeRefPair
> I'm not entirely sure what motivated the need for Multiple vs. Single here.
> The Single one gets used if the service component is a singleton service
> component. The Multiple one gets used for service components that are bundle
> or prototype service components. The Multiple one will key the instances of
> the referenced prototype service by the ComponentContextImpl for the
> requiring service component. That way if there are multiple instances of the
> requiring component each instance (and therefore ComponentContextImpl
> insteance) will get a unique instance of the required prototype service.
> It appears the thought was that some optimizations could have been realized
> for the Singleton case so it has a specialized class separate from Multiple.
> But I think this only makes the code hard to understand and I question that
> the current state of the code is providing any performance improvement.
> I propose we remove the SinglePrototypeRefPair and rename the
> MultiplePrototypeRefPair to be simply PrototypeRefPair.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)