Hi Nicolas, On Mon, 2019-11-18 at 16:15 +0100, Nicolas Peltier wrote: > Hi, > > i have the following use case: > - my bundle has a model A, and a long running thread, using > .adaptTo(A.class) from a resource, > - when upgrading my bundle with thread still running there is a > period when > above adaptTo will return null > > if it is "okay", and i should detect bundle status in my thread, my > question is how best should i do that? > If not, i guess, i'll dive deeper in models implementation :)
If you're waiting for a certain adaptTo call to become valid you can use the Adaption service [1]. Robert [1]: https://github.com/apache/sling-org-apache-sling-adapter/blob/master/src/main/java/org/apache/sling/adapter/Adaption.java
