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 |
Doc Page |
greeter |
a very simple demo of a Greeter OSGi Service exposed remotely and a Consumer invoking on it. |
Walkthrough of the Greeter Demo |
greeter_rest |
a very simple demo of a Greeter OSGi Service exposed remotely as a RESTful service and a Consumer invoking on it. Virtually identical to a greeter sample |
Walkthrough of the Greeter Demo |
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. |
DOSGi Spring-DM Demo page |
ds |
this demo shows how Distributed OSGi can be used with OSGi Declarative Services (DS). |
DOSGi DS Demo page |
discovery |
this demo shows how to use Distributed OSGi with a dynamic Discovery system such as the one based on Zookeeper that comes with CXF/DOSGi. |
DOSGi Discovery Demo page |
iPOJO |
this demo shows how Distributed OSGi can be used with iPOJO |
DOSGi iPOJO Demo page |
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 check out the DOSGi trunk from SVN (http://svn.apache.org/repos/asf/cxf/dosgi/trunk)
- go into the samples directory
- and build them using mvn install