Woden OSGi Proposal

OSGi is a dynamic module system for Java in use in many applications, one of the more prominent applications being Eclipse. This proposal suggests that Woden be packaged as an OSGi bundle so that it can be consumed within an OSGi runtime simply by dropping it into the runtime and activating it.

Creating a Woden OSGi bundle

Modifying Woden to be an OSGi bundle should take minimal effort. Woden will not require an activator (this may change if it makes use of the Eclipse plug-in registry) so creating the bundle will require creating a manifest (Manifest.MF. This file is already included in the Woden jars and will simply need to include OSGi bundle specific information. (Note: In the example below strings are inline for clarity. In the production version they will need to be externalized.)

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Woden API
Bundle-SymbolicName: org.apache.woden.api; singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Apache Software Foundation
Require-Bundle: ...
Export-Package: ...

In the example above the required bundles have deliberately been left out. Woden requires Axiom, commons logging, Geronimo's StAX API, WSDL4J, wstx, Xerces, and XmlSchema (will be made optional post M8). These required projects will need to either be bundled (preferred) or included in the Woden bundle. Commons logging, WSDL4J and Xerces are currently available as bundles from the Eclipse Orbit project but the other requirements will need to be bundled or a bundled version will need to be located.

Package naming convention

Woden is currently packaged as 3 jar files:
A recent change to the build has separated the woden-VERSION-MILESTONE jar into separate DOM and OM jars. This will produce:

While not required by OSGi, Eclipse's naming convention for bundles is to prefix the project name with the organization name and drop the milestone declaration. Adopting this convention will mean Woden's jars will be named as follows (where QUALIFIER is a time stamp associated with each build):

Build changes

Creating a Woden OSGi bundle will likely require an update to the build to include the OSGi runtime on the classpath. Two good options for the OSGi runtime are Apache Felix and Eclipse Equinox.

Comment by Roland Weber: Creating OSGi bundles does not require the OSGi runtime, unless you need to implement a bundle activator or other OSGi-specific code. If you just want to add the OSGi metadata, Maven2 builds can use the Maven Bundle Plugin from Apache Felix, other builds could call the underlying BND tool directly.

Comment by Lawrence Mandel: Good point Roland. Just adding a manifest shouldn't require the OSGi runtime. I'll make sure to check out the links you provided if the Woden OSGi bundles end up requiring activators.

OSGi Repository

OSGi contains a bundle repository that lists OSGi bundles. Bundle providers like Woden can have their bundles included in this repository by creating an XML repository file and submitting it to OSGi. Submitting Woden to the repository should help promote Woden and strengthen the project affiliation with the OSGi community.

Relation to Eclipse

Since the v3.0 release Eclipse has been based on OSGi. Eclipse plug-ins are OSGi bundles that also have the ability to declaratively extend other plug-ins using the plugin.xml file.

For more see the Woden Eclipse Plug-in Proposal.

FrontPage/Woden/WodenOSGi (last edited 2009-09-20 22:48:00 by localhost)