Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Tutorial: Building your first OSGi Remote Service"
(→Define a Service Interface) |
(→Introduction) |
||
Line 1: | Line 1: | ||
==Introduction== | ==Introduction== | ||
− | The OSGi | + | The OSGi Framework provides a very simple model to expose services within a local runtime. Also available, however, is a specification of Remote Services...services that are exported by a distribution provider to allow remote access. The ECF project implements a specification-compliant distribution provider. |
− | This tutorial will show how to define a simple OSGi service | + | This tutorial will show how to |
+ | |||
+ | #define and implement a simple OSGi service | ||
+ | #expose that service for remote access via ECF's implementation of the OSGi Remote Services standard | ||
==Define a Service Interface== | ==Define a Service Interface== |
Revision as of 23:39, 5 December 2013
Introduction
The OSGi Framework provides a very simple model to expose services within a local runtime. Also available, however, is a specification of Remote Services...services that are exported by a distribution provider to allow remote access. The ECF project implements a specification-compliant distribution provider.
This tutorial will show how to
- define and implement a simple OSGi service
- expose that service for remote access via ECF's implementation of the OSGi Remote Services standard
Define a Service Interface
The key to building a system with low coupling and high cohesion is to define clear and coherent boundaries between different parts of your system. Central to this is defining a simple Service Interface...to allow one subsystem to interact with another subsystem, but only in clearly defined ways.
For this example, we are going to define a simple Time Service:
public interface ITimeService { public Long getCurrentTime(); }