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

Carsten Ziegeler commented on SLING-5201:
-----------------------------------------

ResolveContext is actually not that "static" as it gives access to resource 
providers which might have state. So the only method which is static is 
getParentResourceProvider(). I think we should move that one to the 
ProviderContext.

For the implementation I think we can:
- create a ResolveContext on demand, but just once per provider/resource 
resolver.
- we can keep track of the ResolveContext objects and reuse them for the same 
resource resolver

> Improve resource provider resolving
> -----------------------------------
>
>                 Key: SLING-5201
>                 URL: https://issues.apache.org/jira/browse/SLING-5201
>             Project: Sling
>          Issue Type: Improvement
>          Components: ResourceResolver
>            Reporter: Carsten Ziegeler
>             Fix For: API 2.10.0, Resource Resolver 1.2.8
>
>
> With the new implementation, whenever the best matching resource provider for 
> a path is searched, the implementation calls:
> CombinedResourceProvider#getMatchingProviders(path) which returns a list and 
> then the first element from the list is fetched (through the head method).
> I think we could and should avoid creating the unnecessary intermediate list 
> object, and simply return the most matching provider (which is the last one 
> matching)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to