Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] remote services in java applications (no OSGi framework)

Hi All,

I've been working on this and here's a little progress report. Everything described here is available in the ECF ServiceRegistry repo at github [1].

Refactored java-only projects:

1) projects/org.osgi.core.v6: The OSGI R6 framework classes (from OSGi Alliance) 2) projects/org.eclipse.ecf.osgi.serviceregistry: A ServiceRegistry API. Essentially the ServiceRegistry and ServiceRegistryFactory interfaces (plus some classes to support launching with different bundle configs). 3) projects/org.eclipse.ecf.osgi.serviceregistry.connect: An implementation of the ServiceRegistry API based upon the Apache Connect most recent release (1.0.1). 4) projects/org.eclipse.ecf.osgi.serviceregistry.equinox: An implementation of the ServiceRegistry API based upon Equinox 4.5 5) projects/org.eclipse.ecf.osgi.serviceregistry.remoteservices: ECF's implementation of OSGi Remote Services Admin (RSA)

#5 is new, and adds support for using ECF Remote Services/RSA from within Java Applications (i.e. without the OSGi Framework)

Another new thing is that I've added 5 new example projects, that make up 2 remote-services-over-ServiceRegistry (I need to figure out a better name to call this!). These examples are all java-only projects (no bundles).

1) Using existing TimeService host and example consumer code. The time service example is one of the ECF examples distributed with the Remote Services SDK [2]. The timeservice service interface, along with both the host and consumer are used/reused. This shows using DS (on consumer side) to get remote service injection and all the other goodness of DS. And for the host all the remote service registration code is written so there's almost no application code at all.

Projects: projects/examples/com.mycorp.examples.timeservice.sr.host and projects/examples/com.mycorp.examples.timeservice.sr.consumer.ds

2) Using (java-only) service api, host, and consumer example code. This has host registration code, and ServiceTracker-based consumer code as new/separate java projects:

api project (single ITimeService interface class): projects/examples/mycorp.examples.timeservice host project (registers and exports remote service): projects/examples/mycorp.examples.timeservice.sr.host consumer project (ServiceTracker): projects/examples/mycorp.examples.timeservice.sr.host

Included in each of the .host and .consumer projects are launch configs that can be used in Eclipse to launch/run/debug these examples. Note that java-only apps from 1 can *fully interoperate* with actual OSGi-Frameworks, on either the host or consumer side. This means for a given service all these remote service patterns are work just fine:

Java Consumer <-> Java Host
OSGi Consumer <-> OSGi Host
Java Consumer <-> OSGi Host
OSGi Consumer <-> Java Host

It's my intention to write up a new tutorial that use these examples (with Java Consumer <-> Java Host) to correspond with Mars SR (June 24).

Scott

[1] https://github.com/ECF/ServiceRegistry
[2] https://wiki.eclipse.org/Tutorial:_Building_your_first_OSGi_Remote_Service


Back to the top