Hi, that's the only downside of using blueprint for service references. You do have a proxy in your client and aren't notified that it lost the backing service provider. Using ServiceTrackers or Declarative Services leaves you with the direct feedback.
regards, Achim 2014-11-20 15:48 GMT+01:00 Ephemeris Lappis <[email protected]>: > Hello. > > I have some doubts about the correct use of OSGi service references in > Blueprint bundles. I will try to explain them through an example... > > A first blueprint, called provider, creates a bean an exposes it as a > service. > > A second one, called consumer, sets a reference to bind it to the service > and uses it, for example in a camel context... > > If the provider is not present when the consumer is deployed, the > dependency > failure stops the bundle activation. When the provider is correctly > deployed > and activated, the consumer can start and indeed it does. > > Now, if the provider bundle is stopped, using the shell for example, we > expect the failing dependency to be detected, and the consumer bundle to be > stopped too. But it doesn't happen thiw way. > > The provider bundle is marked "Resolved", as expected, and the bundle > doen't > appear as "Created". The consumer bundle remains in state "Active/Created", > until a first processing fails on the missing service. After that, its > state > is "Active/Waiting"... > > Here is the copy of the shell output : > > > > The two test blueprints files are attached. The test case uses a simple > basic java list, although the real bundles uses more complex project's > classes. Anyway, the behavior is the same... > > test-service-consumer.xml > < > http://servicemix.396122.n5.nabble.com/file/n5721899/test-service-consumer.xml > > > test-service-provider.xml > < > http://servicemix.396122.n5.nabble.com/file/n5721899/test-service-provider.xml > > > > At last, I've tested it on versions 4.5.3 and 5.3.0, and had the same > results. > > Someone to confirm my understanding of the relations between dependencies > and blueprint bundles life cycle, or give an idea to reach the expected > behavior ? > > Thanks in advance. > > Regards. > > > > -- > View this message in context: > http://servicemix.396122.n5.nabble.com/Blueprint-service-references-and-bundle-lifecycle-tp5721899.html > Sent from the ServiceMix - User mailing list archive at Nabble.com. > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master
