In our system we have a ServiceFactory SF1 which creates instances of
service S1. The service instance is bound to bundles which have asked
for service from service factory. If I unregister the SF1 then it
leads to unregistrations of all the service instances created from SF1

Now in some case we need to unregister the service instance of S1 for
some specific bundles only.

For example

- Bundle B1 has S1A
- Bundle B2 has S1B
- Bundle B3 has S1C

Where S1X is an instance of S1 produced from SF1

Now a SF interface [1] is as below

Object getService(Bundle bundle, ServiceRegistration registration)

Provides the calling bundle reference and also the ServiceRegistration
object. Would it be fine if Bundle of SF1 invokes the
registration.unregister() method. This would allow us to unregister
services for specific bundle like S1A, S1B but leave service
registered for B3 i.e. S1C

Chetan Mehrotra

[1] 
http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/ServiceFactory.html
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to