Thank you for teachin me, BJ, Tom and Mirko. I got it.
Best regards, ======= Ikuo YAMASAKI On Tue, 14 Jul 2009 08:19:26 -0500 Thomas Watson <[email protected]> wrote: Thomas> Thomas> The latest javedoc states the following: Thomas> Thomas> <javadoc> Thomas> If this bundle's state was ACTIVE prior to setting the state to STOPPING, Thomas> the BundleActivator.stop% method of this bundle's BundleActivator, if one Thomas> is specified, is called. If that method throws an exception, this method Thomas> must continue to stop this bundle and a BundleException must be thrown Thomas> after completion of the remaining steps. Thomas> </javadoc> Thomas> Thomas> Note that the BundleActivator.stop method is only called if the state of Thomas> the bundle was ACTIVE. If there is a BundeActivator specified then the Thomas> bundle can only enter the ACTIVE state after a successful call to Thomas> BundleActivator.start. This means that BundleActivator.stop will only ever Thomas> be call on stop if BundleActivator.start was previously called Thomas> successfully. Mirko is correct that the state diagram does not describe Thomas> the path for stopping a lazy STARTING bundle. This has been discussed Thomas> recently in the CPEG and we are looking to improve the diagram. Thomas> Thomas> Tom Thomas> Thomas> Thomas> Thomas> Thomas> |------------> Thomas> | From: | Thomas> |------------> Thomas> >--------------------------------------------------------------------------------------------------------------------------------------------------| Thomas> |Mirko Jahn <[email protected]> | Thomas> >--------------------------------------------------------------------------------------------------------------------------------------------------| Thomas> |------------> Thomas> | To: | Thomas> |------------> Thomas> >--------------------------------------------------------------------------------------------------------------------------------------------------| Thomas> |OSGi Developer Mail List <[email protected]> | Thomas> >--------------------------------------------------------------------------------------------------------------------------------------------------| Thomas> |------------> Thomas> | Date: | Thomas> |------------> Thomas> >--------------------------------------------------------------------------------------------------------------------------------------------------| Thomas> |07/14/2009 05:41 AM | Thomas> >--------------------------------------------------------------------------------------------------------------------------------------------------| Thomas> |------------> Thomas> | Subject: | Thomas> |------------> Thomas> >--------------------------------------------------------------------------------------------------------------------------------------------------| Thomas> |Re: [osgi-dev] stop() for Lazy Activation Policy | Thomas> >--------------------------------------------------------------------------------------------------------------------------------------------------| Thomas> Thomas> Thomas> Thomas> Thomas> Thomas> Just my interpretation, but I would expect the bundle to enter the Thomas> resolved state (removing the lazy activation flag) without further Thomas> changes. So, only the state changes from starting to resolved, without Thomas> going through the active state. Again, just my "interpretation". The Thomas> only "odd" thing is that this path is not described in the state Thomas> diagram, although pretty common, when shutting down an OSGi runtime Thomas> with not activated bundles. Well, maybe it can be interpreted as the Thomas> case when the activator starts with an exception, there you would have Thomas> the same behavior... Thomas> Thomas> Cheers, Thomas> Mirko Thomas> Thomas> On Tue, Jul 14, 2009 at 8:17 AM, Ikuo Thomas> Yamasaki<[email protected]> wrote: Thomas> > Hi all, Thomas> > Thomas> > I have a question regarding Bundle#stop() against lazy activation policy. Thomas> > Thomas> > Q. What happen , if Bundle#stop() is called for bundle A that is in Thomas> > STARTING state due to lazy activation policy ? Thomas> > Thomas> > According to javadoc of Bundle#stop() in either R4.2 or R4.1 spec, Thomas> > BundleActivator#stop() must be called if specified. Thomas> > Thomas> > However, IMO, it seems strange because Bundle#start() has not been Thomas> > called yet (even the bundle classloader has not been created). Thomas> > Thomas> > Best regards, Thomas> > Thomas> > ======= Thomas> > Ikuo YAMASAKI Thomas> > Thomas> > # If needed, I'll open a bug report on the OSGi bugzilla. Thomas> > Thomas> > _______________________________________________ Thomas> > OSGi Developer Mail List Thomas> > [email protected] Thomas> > https://mail.osgi.org/mailman/listinfo/osgi-dev Thomas> > Thomas> _______________________________________________ Thomas> OSGi Developer Mail List Thomas> [email protected] Thomas> https://mail.osgi.org/mailman/listinfo/osgi-dev Thomas> _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
