joerghoh opened a new pull request, #58:
URL: https://github.com/apache/sling-org-apache-sling-jcr-repoinit/pull/58

   In the AclUtil there are many occassions where privileges and principals are 
resolved over and over again (probably many times the same).
   
   In order to remove the redundant retrieval I added 
``CachingSesssionWrapper`` which is passed instead of the session; by default 
the wrapped session is used, but the following 2 functionalities are executed 
in an optimized way by the CachingSessionWrapper:
   
   * ``privilegesFromNames`` (convert the privilege names into privilege 
objects)
   * ``expandPrivilege`` ( to expand aggregated privileges into the contained 
privileges)
   * ``getPrincipal`` ( to retrieve a principal for a given principal name)
   
   All these results are cached within the CachingSessionWrapper. As this 
object shares the same lifetime as the ``session`` object itself, and as the 
results are immutable, it's safe to do so.
   
   Note: ``getPrincipal`` is safe here, as no principals are removed here.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to