Uninstalls this bundle.
This method causes the Framework to notify other bundles that this bundle is being uninstalled, and then puts this bundle into the UNINSTALLED
state. The Framework must remove any resources related to this bundle that it is able to remove.
If this bundle has exported any packages, the Framework must continue to make these packages available to their importing bundles until the PackageAdmin.refreshPackages
method has been called or the Framework is relaunched.
The following steps are required to uninstall a bundle:
- If this bundle's state is
UNINSTALLED
then an IllegalStateException
is thrown. - 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 {@link FrameworkEvent#ERROR} isfired containing the exception. - This bundle's state is set to
UNINSTALLED
. - A bundle event of type {@link BundleEvent#UNINSTALLED} is fired.
- This bundle and any persistent storage area provided for this bundle by the Framework are removed.
Preconditions getState()
not in { UNINSTALLED
}.
Postconditions, no exceptions thrown getState()
in { UNINSTALLED
}. - This bundle has been uninstalled.
Postconditions, when an exception is thrown getState()
not in { UNINSTALLED
}. - This Bundle has not been uninstalled.
@throws BundleException If the uninstall failed. This can occur ifanother thread is attempting to change this bundle's state and does not complete in a timely manner.
@throws IllegalStateException If this bundle has been uninstalled or thisbundle tries to change its own state.
@throws SecurityException If the caller does not have the appropriate
AdminPermission[this,LIFECYCLE]
, and the Java Runtime Environment supports permissions.
@see #stop()