Java Reference
In-Depth Information
Version getVersion();
void start(int options) throws BundleException;
void start() throws BundleException;
void stop(int options) throws BundleException;
void stop() throws BundleException;
void update(InputStream input) throws BundleException;
void update() throws BundleException;
void uninstall() throws BundleException;
...
}
Each installed bundle is uniquely identified in the framework by its Bundle object.
From the Bundle object, you can also access two additional forms of bundle identifica-
tion: the bundle identifier and the bundle location. You might be thinking, “Didn't we
talk about bundle identification metadata back in chapter 2?” Yes, we did, but don't
get confused. The identification metadata in chapter 2 was for static identification of
the bundle JAR file. The bundle identifier and bundle location are for execution-time
identification, meaning they're associated with the Bundle object. You may wonder
why you need two different execution-time identifiers.
The main difference between the two is who defines the identifier; see figure 3.4.
The bundle identifier is a Java language long value assigned by the framework in
ascending order as bundles are installed. The bundle location is a String value
assigned by the installer of the bundle.
Both the bundle identifier and location values uniquely identify the Bundle object
and persist across framework executions when the installed bundles are reloaded
from the framework's cache.
Create bundle
representation
with bundle ID
Install file: bundle.jar
Installed
bundles
ID=2
Framework
Identity defined by framework
Identity defined by user
Figure 3.4 Difference between the bundle identifiers
Bundle location interpretation
The bundle location has a unique characteristic because most OSGi framework im-
plementations interpret it as a URL pointing to the bundle JAR file. The framework
then uses this URL to download the contents of the bundle JAR file during bundle in-
stallation. The specification doesn't define the location string as an URL, nor is it re-
quired, because you can install bundles from an input stream as well.
 
Search WWH ::




Custom Search