Apache CXF provides the Reference Implementation of the Distribution Software (DSW) component of the Distributed OSGi Specification (RFC 119 in http://www.osgi.org/download/osgi-4.2-early-draft2.pdf).
It implements RFC 119 using Web Services, leveraging SOAP over HTTP and exposing the Web Service over a WSDL contract.
Note that currently this code lives in the sandbox. We are working on moving into the main CXF code base at the moment.
This is work in progress!
Getting Started
To get started, check out the code from http://svn.apache.org/repos/asf/cxf/sandbox/dosgi
Then build & test using:
mvn install
This builds the code, runs the unit and system tests and finally creates two distributions:
distribution/multi-bundle: This distribution is a zip file containing the Distributed OSGi bundles, as well as all their dependencies.
distribution/single-bundle: This is a convenience distribution of a single bundle that embeds all the dependencies.
Running it
Configuration file snippets are automatically generated during the build process. You can paste these snippets in the configuration of you OSGi container to automatically load the bundles for you distribution.
After doing a build, the following snippets are available:
distribution/multi-bundle/target/felix.config.properties.append
distribution/multi-bundle/target/equinox.config.ini.append
distribution/single-bundle/felix.config.properties.append
distribution/single-bundle/equinox.config.ini.append
Note that to run the Distributed OSGi bundles, you need an OSGi container that implements the ListenerHook Service Registry Hook. This is a new feature in OSGi 4.2 which is available in Felix from version 1.4.1 and Equinox 3.5 milestones since December 2008.
Using Felix
Verified with: Felix pre 1.4.1 trunk
- Append the content of the felix.config.properties.append file to the conf/config.properties file that comes with Felix.
- Then start Felix as normal.
For the single-bundle distribution, the following bundles will be present:
*java -jar bin\felix.jar* ... log output ommitted ... -> ps START LEVEL 2 ID State Level Name [ 0] [Active ] [ 0] System Bundle (1.5.0.SNAPSHOT) e Distribution (1.0.0.SNAPSHOT) [ 1] [Active ] [ 1] Apache Felix Shell Service (1.1.0.SNAPSHOT) [ 2] [Active ] [ 1] Apache Felix Shell TUI (1.1.0.SNAPSHOT) [ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.3.0.SNAPSHOT) [ 4] [Active ] [ 2] OSGi R4 Compendium Bundle (4.1.0) [ 5] [Active ] [ 2] Distributed OSGi Distribution Software Single-Bundl
Using Equinox
Verified with: Eclipse Equinox 3.5M4
Using Equinox from with the Eclipse IDE
This option is really handy for debugging. Verified with: Eclipse 3.5M5
Samples
The samples directory contains the following sample projects:
greeter: a very simple demo of a Greeter OSGi Service exposed remotely and a Consumer invoking on it.
spring_dm: a demo created using Spring-DM. Rather than invoking on the OSGi API's directly, the Spring-DM demo shows how you can use Spring to configure your beans as OSGi Services and similarly how to use Spring-DM to invoke a (remote) OSGi Service.