Mapping existing packaging solutions to proposed Fractal packaging scheme
This document shows how the Fractal packaging scheme can be used to present the features of two of the existing packaging systems: OSGi bundles and RPM packages.
Bundles are JAR files that contain resources in a form of class files as well as other data such as HTML files, icons and so on. Each bundle contains a manifest file providing information about the bundle. The manifest file has a defined set of headers processed and used by the OSGi framework.
Metadata is stored in META-INF/MANIFEST.MF file inside the bundle's JAR.
Following information can be provided in the manifest:
Header |
Sample |
Description |
---|---|---|
Bundle-Activator |
com.acme.fw.activator |
The name of the class that is used to start and stop the bundle. |
Bundle-Category |
osgi, test, nursery |
A comma separated list of category names. |
Bundle-Classpath |
/jar/http.jar |
A comma serparated list of JAR file path names (inside the bundle) that should be searched for classes and resources. The period ('.') specifies the bundle itself. |
Bundle-ContactAddress |
2400 Oswego Road |
Contact address if it is necessary to contact the vendor. |
Bundle-Copyright |
OSGi © 2002 |
Copyright specification for this bundle. |
Bundle-Description |
Network firewall |
A short description of this bundle. |
Bundle-DocURL |
http://www.acme.com/firewall/doc |
A URL to documentation about this bundle. |
Bundle-Name |
Firewall |
Name for this bundle. this should be a short name and should contain no spaces. |
Bundle-NativeCode |
/lib/http.dll; |
A specification of native code contained in this bundle's JAR file. |
Bundle-RequiredExecutionEnvironment |
CDC-1.0/Foundation-1.0 |
Comma separated list of execution environments that must be present on the ServicePlatform. |
Bundle-UpdateLocation |
http://www.acme.com/firewall/bundle.jar |
If the bundle is updated, this location should be used (if present) to retrieve the updated jar file. |
Bundle-Vendor |
OSGi |
A text description of this bundle. |
Bundle-Version |
1.1 |
The version of this bundle. |
DynamicImport-Package |
com.acme.plugin.* |
Comma separated list of package names that should be dynamically imported when needed. |
Export-Package |
org.osgi.util.tracker |
Comma separeted list of package names (with optional version specification) that can be exported. |
Import-Package |
org.osgi.util.tracker; specification-version=1.4 |
Comma separated list of package names (with optional version specification) that must be imported. |
Mapping to Fractal packaging system:
The "tags" that describe physical dependencies between OSGi bundles are:
Rest of the information provided in OSGi bundles' manifest is supplemantary and can be expressed through specific Fractal ADL modules.
The proposition on mapping bundle dependencies to the Fractal ADL is as follows:
Client |
Server |
|
---|---|---|
Bundle manifest |
Import-Package:
helloworld.server; specification-version=2.0 |
Export-Package: helloworld.server; specification-version=2.0 |
ADL |
<definition name="Client"/>
|
<definition name="Server"/>
|
The DynamicImport-Package dependency can be mapped using the client collection interface.
The Bundle-ClassPath should only be of importance to the OSGi framework as it tells the Framework where to look for classes inside the current bundle and therefore does not describe external (inter-bundle) dependencies.
RPM packages are files with ".rpm" extension that provide a convenient way of distributing linux software. Each RPM file provides metadata used by the package manager.
The RPM package's metadata is stored in several files in the INFO directory inside the RPM package.
Those files and their content are as follows:
File |
Sample content |
Description |
---|---|---|
BUILDHOST |
dhcp-110-143.idi.ntnu.no |
Host on which this RPM package has been built. |
BUILDTIME |
Tue Apr 27 17:07:29 2004 |
Time when this RPM package has been built. |
CHANGELOG |
(none) |
List of changes applied to this RPM package. |
COPYRIGHT |
GPL |
Copyright specification for this RPM package. |
DESCRIPTION |
Xmms is a multimedia player for the X Window System with an interface similar to Winamp's. Xmms supports playlists and streaming content and has a configurable interface. |
A short description of this RPM package. |
DISTRIBUTION |
|
|
GROUP |
Applications/Multimedia |
A software group to which this RPM package belongs. |
LICENSE |
|
|
NAME-VERSION-RELEASE |
xmms-1.2.10-1 |
Information on this RPM package's name, version and release. |
OBSOLETES |
|
|
OS |
linux |
Operating system to which this RPM package is dedicated. |
PACKAGER |
Haavard Kvaalen |
Name of the person who created this RPM package. |
PROVIDES |
libOSS.so |
List of resources (capabilities) provided by this RPM package. |
REQUIRENAME |
/sbin/ldconfig |
List of resources (capabilities) required by this RPM package (with optional version specification). |
RPMVERSION |
4.2 |
|
SIZE |
5470337 bytes |
Size of this RPM package. |
SOURCERPM |
xmms-1.2.10-10.src.rpm |
RPM package containing source files for this RPM package. |
SUMMARY |
A multimedia player for X which resembles Winamp. |
Summarized information on this RPM package. |
URL |
http://www.xmms.org/ |
URL address for obtaining this RPM package. |
VENDOR |
XMMS Development Team |
Author of this RPM package. |
The files that describe dependencies between RPM packages are:
The contents of the REQUIRENAME and PROVIDES files can be represented as client (required) and server (provided) interfaces in the ADL file in a manner similar to the one in the case of OSGi bundles. In case of OSGi bundles we can specify only the exact version that we want to import. In case of RPM packages, the imported version can be less than, less than or equal, equal, greater or equal, greater than the specified version. This has to be represented by the Fractal ADL interface tag.
Client (version 1.0-1) |
Server (version 5.0-2) |
|
---|---|---|
RPM metadata |
PROVIDES: |
PROVIDES: |
ADL |
<definition name="Client" version="1.0-1"/>
|
<definition name="Server" version="5.0-2"/>
|
Looking at the above two examples, we can draw a conclusion that most packaging systems should be possible to map on the proposed Fractal packaging scheme since the dependencies between packages can usually be expressed in a form of Fractal client/server interfaces and other information can be provided by Fractal ADL modules.