Hi, Thanks for your response.
Yet I am not sure, whether I was clear enough in my question. Let me rephrase it with an example: Consider a service factory Component C. Bundles B1 and B2 have acquired the service, this they get object instances (configurations) Cb1 and Cb2. These two instances are backed a ComponentInstance Cib1 and Cib2. Question is: What happens when dispose() is called on ComponentInstance Cib1 ? Option 1 would be, that Component C is disposed off and thus instances Cb1 and Cb2. Option 2 would be, that only instance Cb1 is disposed off. If I understand the spec correctly, this would be the intended way of the spec. Yet, here is the problem: The Service is not unregistered from the ServiceRegistry, thus Bundle B1 is not informed about the instance Cb1 being deactivated. We can say: no problem, because only Bundle B1 can get at the ComponentInstance Cib1 and thus can take precautions on this situation. Does this sound right an/or understandable ? Thanks and Regards Felix Simon J Archer schrieb: > >>From reading the spec the second option seems correct. > > I agree that (2) is the correct behavior. It would never occur to me to > wish for (1). > >>>But thinking this through in my understanding this means >>>to deactivate an object which has been distributed to >>>consumers by the service registry without informing the >>>service registry about that fact. > > When a ComponentInstance is disposed any services provided by the DS > component are unregistered and removed from the OSGi service registry > before the component is deactivated. Of course, the unregistration of a > service will likely affect other DS components, and so on up the > dependency tree. > > > From: Felix Meschberger <[email protected]> > To: OSGi Developer Mail List <[email protected]> > Date: 11/23/2009 10:19 AM > Subject: [osgi-dev] [DS] Question regarding CompoinentInstance for > service factory components > Sent by: [email protected] > > > ------------------------------------------------------------------------ > > > > Hi all, > > While discussing the development of a Management/Administrative API for > DS we came across a problem with respect to the > ComponentInstance.dispose() method when applied to an instance of a > service factory component. > > There are basically two options: > > (1) dispose() applies to the component as a whole. That is the > service is unregistered and all component instances are > disposed off. > > (2) dispose() applies only to the component instance (object) on whose > ComponentInstance object the method has been called. > >>From reading the spec the second option seems correct. But thinking this > through in my understanding this means to deactivate an object which > has been distributed to consumers by the service registry without > informing the service registry about that fact. > > Thanks for any help. > > Regards > Felix > > _______________________________________________ > OSGi Developer Mail List > [email protected] > https://mail.osgi.org/mailman/listinfo/osgi-dev > > > > ------------------------------------------------------------------------ > > _______________________________________________ > OSGi Developer Mail List > [email protected] > https://mail.osgi.org/mailman/listinfo/osgi-dev _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
