[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] Race conditions with remote provider

I have an ECF container, which I'm using to register services via r-osgi. 

If I register the container service (locator/advertiser) in the bundle's start method, then all works. 

However, I'm refactoring to pass in an ID for the connect method. I can't do this in the bundle start because various callbacks (eg createID) use reflection to find the bundle's classloader, which isn't possible as the start method hasn't returned. 

So I fire up a thread and do it off start thread, but now I have a race condition. 

If I register the service before connecting, then it's possible the client tries to access it in an unconnected state. 

If I wait to register the locator/advertiser service until after the start method is called, none of the r-osgi adverts happen (on the client side). Even stopping/redrafting bundles doesn't seem to trigger it. 

So, how should I be making this available? Or is there an alternate method (say, coming from the plugin.xml's extension points) being triggered and failed with an exception at startup?


Sent from my (old) iPhone