Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-1478

Improve SlingScriptHelper service handling

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Scripting Core 2.0.10
    • Scripting Core 2.0.14
    • Scripting
    • None

    Description

      Felix Meschberger wrote on the Sling dev mailing list:
      The ScriptHelper.getService(Class) method of the Scripting Core bundle
      implementing the SlingScriptHelper API allows scripts to get access to
      OSGi services. This all works perfectly in that the method just forwards
      the call through to the framework.

      At the end of running the script, the service is then "unget".
      Now, the framework will guard access to the service registry and if a
      lot of requests are asking for a service while processing the request,
      even calling repeatedly for the same service during request processing,
      this may result in a contention on the service registry.

      I wonder if we could do better with this method by caching the services
      not only for the time of processing a component but for longer time,
      either during complete request processing or even in a size constrained
      cache (of course unregistered services will have to be removed).

      Attachments

        Issue Links

          Activity

            People

              cziegeler Carsten Ziegeler
              cziegeler Carsten Ziegeler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: