[
https://issues.apache.org/jira/browse/SLING-12376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joerg Hoh updated SLING-12376:
------------------------------
Fix Version/s: (was: Models Implementation 1.7.6)
> Use per thread resource resolver for disposable callbacks
> ---------------------------------------------------------
>
> Key: SLING-12376
> URL: https://issues.apache.org/jira/browse/SLING-12376
> Project: Sling
> Issue Type: Improvement
> Reporter: Carsten Ziegeler
> Assignee: Carsten Ziegeler
> Priority: Major
>
> For clean up (disposal) the model adapter factory uses two approaches - if
> the adaptable is an external (Sling) request, it stores the disposables as a
> request attribute - and the clean up happens at the end of the request via a
> listener.
> For anything else, a phantom reference is added to a queue and that queue is
> clean up periodically (by default all 30 seconds).
> While it would be nice to combine both into a single much approach, this does
> not seem feasible However, we can attach the disposables as closeable
> properties to the current resource resolver (if available) - the clean up
> then happens when the resource resolver is closed (usually at the end of the
> request). This should include all usage of Sling models which are part of a
> request, including internal fake requests.
> For use cases where the thread resource resolver is not available (for
> example during job processing etc.), the existing way of a phantom reference
> can be used.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)