The Apache CXF Distributed OSGi subproject provides the Reference Implementation of the Distribution Provider component of the OSGi Remote Services Specification (Chapter 13 in the OSGi 4.2 Compendium Specification).
It implements the Remote Services functionality using Web Services, leveraging SOAP over HTTP and exposing the Service over a WSDL contract. Starting from version 1.1, Java interfaces can also be exposed and consumed as RESTful JAX-RS services. The 1.2 version of this project is also the Reference Implementation of the OSGi Remote Service Admin specification, chapter 122 in the OSGi 4.2 Enterprise Specification).
This page is about getting started and the demos, further links:
- Distributed OSGi Reference guide
- DOSGi Architecture
- DOSGi Presentations and Articles
- DOSGi Releases
- DOSGi Build page
- DOSGi FAQ page
To get started, get yourself a CXF-DOSGi distribution. The following distributions are available:
- DOSGi Apache Karaf Feature : Allows installation in Apache Karaf using the feature commands (Available as of CXF-DOSGi 1.4.0)
- DOSGi Multi Bundle Distribution: Zip file containing the Distributed OSGi bundles, as well as all their dependencies
- DOSGi Single Bundle Distribution: Convenience distribution of a single bundle that embeds all the dependencies
Which distribution to take? That depends on what you are doing. The single-bundle distribution is a really convenient way of getting started as it provides all of Distributed OSGi plus its dependencies in one.
The multi-bundle distribution is obviously a little more work to install, but the fine-grained bundles do have an extra benefit: they allow sharing. So if your application depends on one or more of the library bundles, it can use them from the multi-bundle distribution. Similarly, the multi-bundle distribution makes it possible to update the dependency bundles - if compatible - without having to replace the Distributed OSGi bundles.
Setting up CXF/DOSGi Discovery
The samples directory contains these sample projects:
Greeter OSGi Service exposed remotely and a Consumer invoking on it.
Greeter OSGi Service exposed remotely as a RESTful service and a Consumer invoking on it. Virtually identical to a greeter sample
Shows how you can use Spring DM to export your beans as OSGi Services and similarly how to use Spring-DM to inject a (remote) OSGi Service.
Shows how Distributed OSGi can be used with OSGi Declarative Services (DS).
Shows how to use Distributed OSGi with a dynamic Discovery system such as the one based on Zookeeper that comes with CXF/DOSGi.
Shows how Distributed OSGi can be used with iPOJO
The samples can be installed directly from the maven release repository (as described in the demo documentation pages), but you can also build them yourself.
To build the samples from source:
- simply browse the DOSGi master using the git web interface (https://git-wip-us.apache.org/repos/asf?p=cxf-dosgi.git) or clone it from (https://git-wip-us.apache.org/repos/asf/cxf-dosgi.git)
- go into the
- and build them using