Carsten Ziegeler created SLING-12376:
----------------------------------------
Summary: 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
Fix For: Models Implementation 1.7.2
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 5 minutes).
I think we can combine both into a single much cleaner approach: attach the
disposables as closeable properties to the current resource resolver - the
clean up then happens when the resource resolver is closed (usually at the end
of the request).
With that we can combine both cases into a single one and remove all the
special handling, queueing, listeners.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)