Hi BJ, Thank you. I got it.
Best regards, Ikuo On Mon, 7 Feb 2011 07:40:08 -0500 BJ Hargrave <[email protected]> wrote: BJ> Even if BundleActivator.stop throws an exception, then bundle will still BJ> be uninstalled. BJ> -- BJ> BJ> BJ Hargrave BJ> Senior Technical Staff Member, IBM BJ> OSGi Fellow and CTO of the OSGi Alliance BJ> [email protected] BJ> BJ> office: +1 386 848 1781 BJ> mobile: +1 386 848 3788 BJ> BJ> BJ> BJ> BJ> BJ> From: Ikuo Yamasaki <[email protected]> BJ> To: [email protected] BJ> Date: 2011/02/06 23:56 BJ> Subject: [osgi-dev] Q on Bundle#uninstall() BJ> Sent by: [email protected] BJ> BJ> BJ> BJ> Hi all, BJ> BJ> R4.2 Core Spec "6.1.4.35 public void uninstall( )" says: BJ> BJ> --begin quote--- BJ> The following steps are required to uninstall a bundle: BJ> 1 If this bundle’s state is UNINSTALLED then an IllegalStateException is BJ> thrown. BJ> 2 If this bundle’s state is ACTIVE, STARTING or STOPPING, this bundle is BJ> stopped as described in the Bundle.stop method. If Bundle.stop throws BJ> an exception, a Framework event of type FrameworkEvent.ERROR is BJ> fired containing the exception. BJ> 3 This bundle’s state is set to UNINSTALLED. BJ> 4 A bundle event of type BundleEvent.UNINSTALLED is fired. BJ> 5 This bundle and any persistent storage area provided for this bundle by BJ> the Framework are removed. BJ> --end quote--- BJ> BJ> BJ> --begin quote--- BJ> Postconditions, when an exception is thrown BJ> - getState() not in { UNINSTALLED }. BJ> - This Bundle has not been uninstalled. BJ> --end quote--- BJ> BJ> It seems umbiguous that the step 3,4 and 5 will be done if BJ> this bundle's state was ACTIVE, STARTING or STOPPING and Bundle.stop BJ> throws an exception (FrameworkEvent is fired). BJ> BJ> My understanding is : BJ> - step 3,4 and 5 will be done even if the Bundle.stop() throws an BJ> exception. BJ> Therefore, bundle state will be UNINSTALLED. BJ> BJ> - If Bundle.uninstall() throws an exception (BundleException, BJ> IllegalStateException, or SecurityException), the bundle state will be BJ> not UNINSTALLED (except if precondition is alread UNINSTALLED and BJ> IllegalStateException is thrown). BJ> BJ> Is my understanding correct ? BJ> BJ> Best regards, BJ> BJ> ======= BJ> Ikuo YAMASAKI BJ> BJ> BJ> _______________________________________________ BJ> OSGi Developer Mail List BJ> [email protected] BJ> https://mail.osgi.org/mailman/listinfo/osgi-dev BJ> ======= Ikuo YAMASAKI _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
