Hi, In AEM we have for quite some time "fake" implementations of SlingHttpServletRequest and SlingHttpServletResponse, which are used as parameters for the SlingProcessor to render content.
We came across issues when SlingModels are involved in the rendering process. We found that this approach can create memory leaks when OSGI services are injected into sling models, and these are created during the rendering process of such a "fake request". The problem is that the unregistering of these OSGI references is triggered by a ServletRequestEvent which the ModelAdapterFactory receives as it registers as a ServletRequestListener. But these fake classes do not implement these methods at all. Checking the sling equivalents in [1] I don't see them implementing these functionality as well, thus they show the same problem. Would there be some interest to have this functionality implemented in Sling? (I am not an expert in the servlet spec, so don't expect anything soon from my side...) Jörg [1] https://github.com/apache/sling-org-apache-sling-api/tree/master/src/main/java/org/apache/sling/api/request/builder -- Cheers, Jörg Hoh, https://cqdump.joerghoh.de Twitter: @joerghoh
