[ 
https://issues.apache.org/jira/browse/SLING-4026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14180543#comment-14180543
 ] 

Justin Edelson edited comment on SLING-4026 at 10/22/14 9:12 PM:
-----------------------------------------------------------------

You are correct - there is a potential for a gap between the time that the 
AdapterFactory service is available and the AdapterManagerImpl registers it. 
Sorry I gave you wrong information.

If you wanted to be sure that the AdapterFactory was registered, with the 
AdapterManager, you could listen for the 
org/apache/sling/api/adapter/AdapterFactory/ADDED event.




was (Author: justinedelson):
You are correct - there is a potential for a gap between the time that the 
AdapterFactory service is available and the AdapterManagerImpl registers it. 
Sorry I gave you wrong information.

If you wanted to be sure that the AdapterFactory was registered, you could 
listen for the org/apache/sling/api/adapter/AdapterFactory/ADDED event.



> Sling Models Race Condition
> ---------------------------
>
>                 Key: SLING-4026
>                 URL: https://issues.apache.org/jira/browse/SLING-4026
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Sling Models Implementation 1.1.0
>            Reporter: JBodkin
>              Labels: models
>         Attachments: racer.zip
>
>
> During initialization of a bundle, it is possible to encounter a race 
> condition in which the BundleTrackerCustomizer::addingBundle(Bundle bundle, 
> BundleEvent event) is triggered after the bundle has begun initialization of 
> a immediate component.
> {code:java}
> @Component(immediate = true)
> @Service
> public class ExampleImpl {
>     @Activate
>     public void activate(ComponentContext context) {
>         Resource resource = ....
>         // Race condition possible here... Could be executed before the 
> BundleTracker (ModelPackageBundleListener)
>         SlingModelExample example = resource.adaptTo(SlingModelExample);
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to