[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ecf-dev] Race conditions with remote provider
- From: Alex Blewitt <alex.blewitt@xxxxxxxxx>
- Date: Mon, 6 Jun 2011 18:14:54 +0100
- Delivered-to: firstname.lastname@example.org
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:content-type:x-mailer:message-id:date:to :content-transfer-encoding:mime-version; b=Ndu9LNo2xyRkfpuUjja8tju9W5kSi1mCIByEXQYwc1SJ6/uI4P48i6LAUC5p9lvVhK Wk7j51+iEoEZAeAQR76X2d9HaA+9KJfBAz9D1Lyaz34i6Ey9Q6yTu/842OM8lsILKmmm dPmGjTQ0Jmi4IvAWGUe8VuPmWjWXvZtfh2kNI=
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