felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: SynchronousBundleListener really synchronous during bundle start ?
Date Tue, 13 Dec 2011 16:32:27 GMT
A synchronous bundle listener will be notified on the calling thread 
that made the bundle become ACTIVE, whereas a normal bundle listener may 
not. If you are trying to be notified before a bundle becomes ACTIVE, 
then you need to be listening for a STARTING event.

-> richard

On 12/12/11 05:59 , metatech wrote:
> Hello,
> After debugging Apache Camel, I found out that it uses a
> SynchronousBundleListener to be notified when a Camel bundle reaches the
> "Active" state.
> However, when I define a breakpoint in the "activateBundle" method of class
> "Felix.java", I see that the bundle state is already "Active", although the
> SynchronousBundleListener has not been called yet.  Indeed, the
> "setBundleStateAndNotify" method is called before the "fireBundleEvent".
> My understanding is that other bundles which rely on the initialization
> called in the SynchronousBundleListener are allowed to start, although the
> dependent bundle is not fully started.  This can raise a race condition
> between both components.
> Did I overlook anything ?
> Can anyone explain whether the Felix code can be subject to such a race
> condition ?
> Thanks.
> metatech
> Reference :
> http://camel.465427.n5.nabble.com/Camel-under-OSGi-without-Spring-et-al-td4507473i20.html#a5038265

To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org

View raw message