Hi BJ,
On Thu, 26 May 2011 18:46:25 -0400
BJ Hargrave <[email protected]> wrote:
BJ> No. If stop completes with an exception, uninstall can still proceed.
BJ> Uninstall can fail if the state change lock is held by another thread and
BJ> that thread does not release the lock in some reasonable time.
Spec says:
-- quote -------------------------------------------------------
public void stop( int options ) throws BundleException
2 If this bundle is in the process of being activated or deactivated then this
method must wait for activation or deactivation to complete before continuing.
If this does not occur in a reasonable time, a BundleException is
thrown to indicate this bundle was unable to be stopped.
-- quote -------------------------------------------------------
It seems to me there exists two cases:
Case1: Bundle.stop() throws BundleException due to the above reason.
(Bundle#uninstall() does not throw BundleException)
Case2: the state change lock is held by another thread and
that thread does not release the lock in some reasonable time.
(Bundle#uninstall() throws BundleException)
Q1. Does Case2 include Case1 or not ?
For me, yes.
Q2. when should those check for Case2 be done in the following steps
described in "6.1.4.35 public void uninstall( )"
--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---
Q3. Even in Case2, step 3-5 should be done. Is my understanding correct ?
=======
Ikuo YAMASAKI
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev