An installed bundle in the Framework.
A Bundle
object is the access point to define the lifecycle of an installed bundle. Each bundle installed in the OSGi environment must have an associated Bundle
object.
A bundle must have a unique identity, a long
, chosen by the Framework. This identity must not change during the lifecycle of a bundle, even when the bundle is updated. Uninstalling and then reinstalling the bundle must create a new unique identity.
A bundle can be in one of six states:
- {@link #UNINSTALLED}
- {@link #INSTALLED}
- {@link #RESOLVED}
- {@link #STARTING}
- {@link #STOPPING}
- {@link #ACTIVE}
Values assigned to these states have no specified ordering; they represent bit values that may be ORed together to determine if a bundle is in one of the valid states.
A bundle should only execute code when its state is one of STARTING
,ACTIVE
, or STOPPING
. An UNINSTALLED
bundle can not be set to another state; it is a zombie and can only be reached because references are kept somewhere.
The Framework is the only entity that is allowed to create Bundle
objects, and these objects are only valid within the Framework that created them.
@ThreadSafe
@version $Revision$