[
https://issues.apache.org/jira/browse/SLING-4352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14933895#comment-14933895
]
Dirk Rudolph edited comment on SLING-4352 at 9/28/15 8:08 PM:
--------------------------------------------------------------
You could also expose an abstract ResourceResolverWrapper in the API which
implements the actual ResourceResolver interface with delegation. The
implementation would then only replace the close method. In that case both,
servlet resolver and resource resolver API are still decoupled (depending on
the major version only I think) but without introducing reflection and without
intercepting any method invocation.
And maybe ResourceResolverWrapper would be useful in other use-cases as well.
was (Author: diru):
You could also expose an abstract ResourceResolverWrapper in the API which
implements the actual ResourceResolver interface with delegation. The
implementation would then only replace the close method. In that case both,
servlet resolver and resource resolver API are still decoupled but without
introducing reflection and without intercepting any method invocation.
And maybe ResourceResolverWrapper would be useful in other use-cases as well.
> The ResourceResolver passed to SlingScripts should not be closeable
> -------------------------------------------------------------------
>
> Key: SLING-4352
> URL: https://issues.apache.org/jira/browse/SLING-4352
> Project: Sling
> Issue Type: Bug
> Components: Servlets
> Reporter: Radu Cotescu
> Assignee: Carsten Ziegeler
> Fix For: Servlets Resolver 2.3.8
>
>
> The {{SlingServletResolver}} uses an administrative resource resolver
> ({{sharedScriptResolver}}) for script resolution. This same resolver is
> passed to SlingScripts when a resource is adapted to a {{SlingScript}} in
> {{SlingServletResolver#findScript}} (see
> {{SlingScriptAdapterFactory#getAdapter}}).
> Since this resolver is made available to scripts in the {{ScriptContext}}
> (see the implementation of {{DefaultSlingScript#call}}), the resolver should
> be protected against accidental closing from downstream callers.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)