Closed mcculls closed 9 years ago
Thanks, I'm still finishing unit tests for the new flush functionality and hadn't got
round to do stress tests. BTW the service unavailable exception is valid, because the
thread is trying to use a service which is no longer available, and the thread should
expect this (as OSGi services may go at any time *) and in this case ignore it.
I'll also take a look at your other changes and hope to commit this fix later today.
(* I might also add another decorator utility that provides a "no-op" service for
when no service is available - this could be used by clients when they don't want to
handle the service unavailable exception...)
Reported by mcculls
on 2008-10-08 10:05:31
Accepted
Yes all code should be ServiceUnavailableException-tollerant under the dynamic
conditions of OSGi. This is the one little thing no ammount of smarts can hide from
the poor bundle developer :)
Nice idea to have an additional decorator. That reminds me of Felix' NullObject
pattern. Here's something for your idea bag (in case you it ain't there already):
http://felix.apache.org/site/dependency-manager-background.html
http://felix.apache.org/site/dependency-manager-usage.html#DependencyManagerUsage-
Implementingtheservice
It sould be easy to generate NullObjects on the fly with ASM. Than some additional
EDSL method like "DynamicServiceBuilder.asOptional()" can be added to trigger this
behavior.
Reported by Rinsvind
on 2008-10-08 11:23:55
Reported by mcculls
on 2008-10-16 07:21:48
Fixed
Reported by mcculls
on 2008-10-16 07:22:24
Reported by mcculls
on 2009-02-03 09:40:32
Verified
Originally reported on Google Code with ID 7
Reported by
Rinsvind
on 2008-10-08 09:35:43