Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-5668

Models: Leverage ServletRequestListener.requestDestroyed for calling DisposalCallback in case the model was created from a request

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Sling Models Impl 1.2.6
    • Models Impl 1.4.6
    • Extensions
    • None

    Description

      Due to SLING-5664 I had to remove usage of SlingScriptHelper in the OSGiServiceInjector. Therefore now always the DisposableCallbackRegistry is used to release service references. That mechanism relies on a dedicated thread (https://github.com/apache/sling/blob/b864f105617c0ac7c2d525bfdb66eda2200c6460/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java#L133) and phantom references (https://github.com/apache/sling/blob/b864f105617c0ac7c2d525bfdb66eda2200c6460/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java#L504). In case of acting on top of a request one could leverage ServletRequestListener.requestDestroyed(...) instead, which is more reliable and called earlier than relying on phantom references.

      Attachments

        Issue Links

          Activity

            People

              justinedelson Justin Edelson
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: