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