kwin commented on a change in pull request #1: SLING-7313 refresh the resource 
type resolver as well
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/1#discussion_r157487858
 
 

 ##########
 File path: 
src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java
 ##########
 @@ -148,12 +148,20 @@ private void logout() {
     }
 
     /**
-     * Refreshes all refreshable providers.
+     * Refreshes all refreshable providers as well as the resolver used for 
resource types.
      */
     public void refresh(@Nonnull final ResourceResolverContext context) {
         for (final AuthenticatedResourceProvider p : 
context.getProviderManager().getAllUsedRefreshable()) {
             p.refresh();
         }
+        if (this.resourceTypeResourceResolver != null) {
+            try {
+                this.resourceTypeResourceResolver.close();
+            } catch ( final Throwable t) {
+                // the resolver (or the underlying provider) might already be 
terminated (bundle stopped etc.)
 
 Review comment:
   Ok, agree.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to