A New Strategy of Language Pack Management for Wireless Apps
By Huang Chang & Tong Chun Jie2005-04-18
OSGi Overview
As depicted in the graph in Figure 1, the software components managed by OSGi are called bundles, which are standard Java Archive (JAR) files. An OSGi application normally has a toy trick-like structure, which means during its total life cycle it might invoke an arbitrary number of bundles. Besides reusability, the design fundamental of the bundle also takes the limited device storage into consideration. All the participating bundles are not required to be available on the device when the application is started. Instead, when a bundle is found to be missing on the device side, the OSGi service platform delegates the application to fetch the needed bundle from the management server and install it in the run time. After invoking, those bundles that are never used can be uninstalled by the invoker application to free the storage. The OSGi bundle is completely self-contained with all the necessary metadata in its manifest file. OSGi bundles can be installed, updated, or removed on the fly without ever having to disrupt the operation of the device.
Figure 1. OSGi architecture
The OSGi provides powerful ways for bundles to interact with each other. Interactions between bundles generally fall into two categories: static sharing or dynamic services.
• Static sharing: The OSGi container runs on a single Java Virtual Machine (JVM) instance, but has a different class loader for each bundle. That means bundle namespaces are separate. You cannot directly access objects or classes in another bundle by default. However, a bundle can explicitly export some of its Java packages through the Export-Package attribute in its manifest file. It can also import Java packages exported by others using the Import-Package manifest attribute. The export and import features allow direct sharing of Java packages.
• Dynamic services: In addition to standard services provided by the container, any bundle can consume and provide services from and to other bundles at the same time. A bundle can dynamically register (or unregister) services with the container so that another bundle can find the service reference through a lookup API in the framework.
For details about OSGi, please refer to the OSGI documentation (see Resources).
First published by IBM DeveloperWorks
|
|||||||||
You might also want to check these out:
|
Leave a Comment on "A New Strategy of Language Pack Management for Wireless Apps"
You must be logged in to post a comment.
Link to This Tutorial Page!

