Radu Cotescu created SLING-11119:
------------------------------------
Summary: Optimise service retrieval for HTL bundled scripts
Key: SLING-11119
URL: https://issues.apache.org/jira/browse/SLING-11119
Project: Sling
Issue Type: Improvement
Components: Scripting
Reporter: Radu Cotescu
Assignee: Radu Cotescu
Fix For: Scripting HTL Engine 1.4.18-1.4.0
The current implementation of
{{org.apache.sling.scripting.sightly.impl.engine.bundled.BundledUnitManagerImpl}}
relies on the actual {{BundledRenderUnit}} to retrieve OSGi services that are
used by the bundled (precompiled) script. That implementation is provided by
the
{{org.apache.sling.scripting.core.impl.bundled.AbstractBundledRenderUnit#getService}}
method, but given its execution context has a shorter lived cache in which
OSGi services are kept. In addition, that implementation also suffers from
SLING-11118 for the moment.
Since the
{{org.apache.sling.scripting.core.impl.bundled.ScriptContextProvider}} service
actually provides a {{org.apache.sling.scripting.core.ScriptHelper}}
implementation capable of retrieving OSGi services with the correct classloader
that provides the bundled (precompiled) script, the HTL
{{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
should try to use the {{ScriptHelper}} in this scenario, if one is available,
otherwise fallback to the {{BundledRenderUnit}} like before.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)