[ 
https://issues.apache.org/jira/browse/SLING-9365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17084691#comment-17084691
 ] 

Julian Sedding commented on SLING-9365:
---------------------------------------

A solution somewhere in between having a ResourceProvider for every servlet and 
having none at all might be a single RP for all servlets. It could bind 
servlets dynamically and thus wouldn't need to be restarted. I'm not sure 
if/how that could be done. But handling the addition/removal of servlets inside 
a specialised implementation might allow for some shortcuts to make it 
performant.

 

Another way we have to inject Resources into a tree is the ResourceDecorator 
interface, which I have used in projects to "mount" read-only resource trees 
onto arbitrary resources. This would alow for a similar implementation as 
above, but might be simpler? The only thing that's a little tricky is that in 
order to decorate a hierarchy, the ResourceResolver needs to be (properly) 
decorated as well. I'm not sure that this approach allows sending resource 
added/removed events, but I suppose it should be possible.

 

> Optimize servlet to resource provider servlet mounter
> -----------------------------------------------------
>
>                 Key: SLING-9365
>                 URL: https://issues.apache.org/jira/browse/SLING-9365
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>    Affects Versions: Servlets Resolver 2.6.4
>            Reporter: Karl Pauls
>            Assignee: Karl Pauls
>            Priority: Major
>             Fix For: Servlets Resolver 2.6.6
>
>
> The current ServletMounter creates a resource provider for each registered 
> servlet. That works fine for a given amount of servlets but can become 
> problematic for a high number of servlets as it means that on the one hand, 
> the number of services is doubled and on the other hand, a lot of 
> notifications are send out as well as a lot of computation has to be done by 
> the resource resolver. 
> As an optional remedy for these kinds of scenarios, we should allow to 
> configure the mounter to instead provide a single resource provider that has 
> manages the servlets internally.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to