ServiceEvents are defined in the spec as being delivered on the calling thread (i.e., synchronously). I agree, this sucks and shouldn't be that way, but the spec says so.

-> richard

Jacques-Olivier Goussard wrote:
Hi
I just found a deadlock in our code that was the result of the lack of
asynchronicity. When a service is registered in felix, the trackers are
notified in the same thread. Is
it the intended behavior ?
Looks to me that could lead to a very deep stack of invocation, no ? Of
course I can fix this by doing my service regsitration in a separate thread,
but I wanted
to check first with you for input.
Thanks
               /jog
Here I paste an exerpt of the stack trace I have:

        at
com.oz.platform.messaging.routing.RoutingManager.handleServiceEvent(RoutingManager.java:592)

        at
com.oz.platform.osgi.ComponentPlatform$ServiceNotifier.addingService(ComponentPlatform.java:244)

        at
org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1030)

        at
org.osgi.util.tracker.ServiceTracker$Tracked.track(ServiceTracker.java:1008)

        at
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:941)

        at
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:765)

        at
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:623)

        at
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:554)

        at
org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3566)

        at org.apache.felix.framework.Felix.access$200(Felix.java:37)

        at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:833)

        at
org.apache.felix.framework.ServiceRegistry.fireServiceChanged(ServiceRegistry.java:559)

        at
org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:75)

        at org.apache.felix.framework.Felix.registerService(Felix.java:2713)

        at
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:252)

        at
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:230)

        at
com.oz.platform.osgi.ComponentPlatform.registerService(ComponentPlatform.java:130)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to