DOSGi in the OSGi spec

Distributed OSGi is described in the OSGi core spec in chapter 6 (Remote Services) and in the OSGi compendium spec in chapter 122 (Remote Service Admin Service).

The Remote Services spec describes a module named Distribution Provider that makes OSGi services available across container boundaries. The idea is to use special service properties to mark services that are to be exported remotely. The Distribution provider will create Endpoints for these services that are available outside the container. On the consumer side the Distribution Provider can create local OSGi services that act as proxies for the remote services and allow service consumers to use them to call the remote service.

Full Size
A Gliffy Diagram named: remote-services-spec

The Remote Service Admin spec then splits the Distribution provider into separate modules that communicate through defined interfaces. This allows to change or enhance parts of an existing DOSGi implementation without having to reimplement the whole Distribution provider.

Full Size
A Gliffy Diagram named: remote-service-admin-spec

Modular Distribution Provider described in the Remote Service Admin Service spec.

Modules and their Roles

  • Discovery: Detects available Remote Endpoints and notifies EndpointListeners
  • Topology Manager: Monitors available and requested local OSGi Services. Monitors remote OSGi services using an EndpointListener. Delegates creation of Endpoints and Proxies to RemoteServiceAdmin.
  • Remote Service Admin: Creates and Destroys Endpoints and Proxys and notifies RemoteServiceAdminListeners. Only reacts to commands sent over the Remote Service Admin interface.

Notes:

  • There can be more than one Discovery Impl and Topology Manager Impl at the same time
  • For one service the Remote Service Admin can create more than one endpoint (e.g SOAP and Rest)

CXF DOSGi

Spec Module
CXF Module
Description
Discovery
cxf-dosgi-ri-discovery-local Describes Remote Endpoints using local configuration
  cxf-dosgi-ri-discovery-distributed Discovers and Announces Endpoints using a Zookeeper Server
Topology Manager
cxf-dosgi-ri-topology-manager Basic Topology Manager Implementation
Remote Service Admin
cxf-dosgi-ri-dsw-cxf Creates Endpoints and Proxies using the CXF Framework

Shows how the CXF DOSGi modules map to the spec. In the next chapters we look into each of these modules.

Topology Manager

Full Size
A Gliffy Diagram named: cxf-dosgi-topology-manager

Discovery Ditributed with Zookeeper

Full Size
A Gliffy Diagram named: cxf-dosgi-discovery-distributed

Remote Service Admin

Full Size
A Gliffy Diagram named: cxf-dosgi-remote-service-admin