Hi Rob, The RuntimeExtensions are meant to process the outcome of a Sightly expression. If such an extension would need to perform some processing based on component resolution it's fair to pass it the same resolver that the ServletResolver used.
I'll document in the RenderContext that this resolver should only be used for component resolution, explicitly specifying that for content resolution the request's resolver (available from the RenderContext#getBindings) should be used. An extension can be called multiple times during the rendering of the same page; if this extension would be called 20 times for the rendering of one page and if the extension needs a resource resolver to handle its processing, I'd *really* like to avoid creating 20 resource resolvers if I could just use the ServletResolver RR, which is passed down anyways to script engines, through the ScriptContext. Regards, Radu On Fri, Jan 23, 2015 at 4:11 PM, Rob Ryan <rr...@adobe.com> wrote: > We do *not* want to allow a resolver passed around from the > ServletResolver to be abused for accessing general content. If Slightly > RuntimeExtensions need more access than the ServletResolver they should > manage a resolver themselves. > > Also, this sounds like premature optimization. > > If ResourceResolver creation is slow the ROI on making it faster is likely > significant as multi-thread usage of a session in Oak degrades performance > rapidly. >