Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-3569

Improve configured method handling for ComponentFactory instances

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • scr-1.6.0
    • scr-1.6.2
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              djencks David Jencks
              fmeschbe Felix Meschberger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: