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:

Getting Started

To get started, get yourself a CXF-DOSGi distribution. The following distributions are available:

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

See the DOSGi Discovery page and the DOSGi Discovery Demo page.

The Samples

The samples directory contains these sample projects:

Sample

Description

greeter

Greeter OSGi Service exposed remotely and a Consumer invoking on it.

greeter_rest

Greeter OSGi Service exposed remotely as a RESTful service and a Consumer invoking on it. Virtually identical to a greeter sample

spring_dm

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.

ds

Shows how Distributed OSGi can be used with OSGi Declarative Services (DS).

discovery

Shows how to use Distributed OSGi with a dynamic Discovery system such as the one based on Zookeeper that comes with CXF/DOSGi.

iPOJO

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:

  1. 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)
  2. go into the samples directory
  3. and build them using mvn install