Hi, Simon.
Good question. With "plain" OSGi, the services provided or consumed by an
OSGi bundle are programmed as BundleContext.registerService() or
BundleContext.getServiceReference(). Some declarative approaches such as DS,
RFC 124 and iPOJO is trying to abstract them out to form an OSGi-based
component model.
As the first step, I'll try to use a static bundle.componentType as the
starting point to describe the OSGi references and services for a bundle in
the SCA term. Then we'll explore how we can derive it from the RFC 124
module components. To the most dynamic case, we'll have to watch the Bundle
and the ServiceRegistry (RFC 126) to build up a "dynamic" componentType.
On the other hand, the wirings can be dynamic too as the OSGi services can
come and go. We will have to look into different cases such as:
* Wiring strategy: static wires, autowire and wireByImpl
* Contributions come and go
* Services and references come and go
We will come to these tricky things after we have the basics working (Adding
distribution to OSGi services).
Thanks,
Raymond
--------------------------------------------------
From: "Simon Laws" <[email protected]>
Sent: Wednesday, March 11, 2009 11:17 AM
To: <[email protected]>
Subject: Re: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA
On Tue, Mar 10, 2009 at 9:19 PM, Raymond Feng <[email protected]> wrote:
Hi,
OSGi RFC 119 [2] specifies how OSGi services can be distributed using SCA
as
the distribution software. We have seen user interests in Tuscany
community
to implement RFC 119 using Java SCA [3].
I begin to look into this area recently. You can find a set of slides [1]
I
put together to better understand the usage scenario and a high level
view
of the work. The main idea is to use <implementation.osgi> to model an
OSGi
bundle in SCA and provide remoting for OSGi services using SCA bindings
and
intents. I have also started to port (from 1.x) and develop the
implemention.osgi module. The code is available at [4].
This is just the starting point. Your feedback is welcome. Please feel
free
to jump in if you are interested in helping out.
Thanks,
Raymond
[1]
http://cwiki.apache.org/confluence/download/attachments/112304/RFC+119+with+Tuscany+SCA.pdf
[2]
http://www.osgi.org/Download/File?url=/download/osgi-4.2-early-draft2.pdf
[3] http://www.mail-archive.com/[email protected]/msg05305.html
[4]
http://svn.apache.org/repos/asf/tuscany/java/sca/modules/implementation-osgi/
Yep, nice work Ramond.
A component type/wiring question for you.
Without a component type side file (or other meta-data) I assume you
need to load and activate the bundle that is the component
implementation in order to determine the component type.
From an SCA point of view a component type would tend to be static but
the way that a component type's references and services are wired
could be dynamic (although we don't support that today in Tuscany at
runtime) and kind of wireByImpl in SCA terms.
Are these things intrinsically linked in this case though to the
extent that you can't do component type "introspection" without
supporting full dynamic wiring?
Simon