[ https://issues.apache.org/jira/browse/FELIX-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399614#comment-13399614 ]
Felix Meschberger commented on FELIX-3569: ------------------------------------------ There is no particular reason, except maybe not thinking this through ;-) I would prefer to keep the metadata clean. I was rather thinking of the ComponentHolder objects holding the actual component manager instances. On the other hand using the ComponentHolder would require some kind of multiplexing for the bind methods. Yet, if we use a map indexed by the method intent something like "activate", "deactivate", "modified", "<refname>.bind", "<refname>.unbind", "<refname>.updated". Considering, using the metadata would at least be straightforward in that multiplexing is already handled... > Improve configured method handling for ComponentFactory instances > ----------------------------------------------------------------- > > Key: FELIX-3569 > URL: https://issues.apache.org/jira/browse/FELIX-3569 > Project: Felix > Issue Type: Improvement > Components: Declarative Services (SCR) > Affects Versions: scr-1.6.0 > Reporter: Felix Meschberger > > Currently the ComponentFactory.newInstance method creates a new instance of > an extension of the ImmediateComponentManager class to create a new component > instance. > Since configured methods to be called on the component (activator and bind > methods) are maintained by these ImmediateComponentManager and its related > DependencyManager instances, these methods are looked up over and over again > for the same component class. > In a web application using Sling's Rewriter which leverages ComponentFactory > components to postprocess requests this amounts to a considerable number of > repeated and needless reflection calls. This is particularly nasty in case of > methods not existing. > The same problem in fact also occurrs for components created due to factory > configuration, where for each configuration instance a ComponentManager and > its associated DependencyManagers is created to lookup the methods. > We might want to come up with a centralized method accessor functionality > which caches these methods and provides them to any ComponentManager and > DependencyManager needing them. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira