You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2009/03/10 22:19:08 UTC

[2.x] OSGi RFC 119 implemention using Tuscany Java SCA

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/dev@tuscany.apache.org/msg05305.html
[4] 
http://svn.apache.org/repos/asf/tuscany/java/sca/modules/implementation-osgi/ 


Re: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Mar 11, 2009 at 7:06 PM, Raymond Feng <en...@gmail.com> wrote:
> 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.
>
 snip....

+1 completely agree this is the right approach.

Thinking endpoints at the moment so just exercising my mind about what
sort of flexibility might be required.

Simon

Re: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA

Posted by Raymond Feng <en...@gmail.com>.
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" <si...@googlemail.com>
Sent: Wednesday, March 11, 2009 11:17 AM
To: <de...@tuscany.apache.org>
Subject: Re: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA

> On Tue, Mar 10, 2009 at 9:19 PM, Raymond Feng <en...@gmail.com> 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/dev@tuscany.apache.org/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 


Re: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA

Posted by Simon Laws <si...@googlemail.com>.
On Tue, Mar 10, 2009 at 9:19 PM, Raymond Feng <en...@gmail.com> 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/dev@tuscany.apache.org/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

RE: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA

Posted by "Konradi, Philipp" <ph...@siemens.com>.
Hi Raymond,

that are great news! 

The ideas presented in the slide set look good to me. If I understand
the last slide correctly, that would also be a start for work to
introduce some dynamism in SCA domains. Is that correct?

Regards, 
Philipp


> -----Original Message-----
> From: Raymond Feng [mailto:enjoyjava@gmail.com]
> Sent: Tuesday, March 10, 2009 10:19 PM
> To: tuscany-dev
> Subject: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA
> 
> 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/dev@tuscany.apache.org/msg05305.html
> [4]
>
http://svn.apache.org/repos/asf/tuscany/java/sca/modules/implementation
> -osgi/


Re: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA

Posted by Raymond Feng <en...@gmail.com>.
Dan, you are confused by the coincidence that the bundle symbolic name is 
the same as the interface name. In fact, the symbolic name can be anything 
that uniquely identifies the bundle. There is no relation between the it and 
the interface name.

For the OSGi services part, I'll respond to Simon's e-mail.

Thanks,
Raymond

--------------------------------------------------
From: "Dan Becker" <da...@gmail.com>
Sent: Wednesday, March 11, 2009 9:28 AM
To: <de...@tuscany.apache.org>
Subject: Re: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA

> Hi Raymond,
>
> Fantastic job with both the presentation and the accompanying code.
>
> I have one question. I see from the osgitest.composite that the service 
> interface is referenced by the following element:
>         <tuscany:implementation.osgi bundle="OSGiTestService" 
> bundleSymbolicName="org.apache.tuscany.sca.implementation.osgi.test.OSGiTestInterface" 
> />
>
> How is the bundle and bundleSymbolicName used to look up the bundle of the 
> component service? Is this information enough to find the required 
> service?
>
> (P.S. Perhaps I missed the answer in the presentation, but this might be a 
> useful question and answer for your PDF.)
>
>
> Raymond Feng wrote:
>> 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].
>>
>> [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/dev@tuscany.apache.org/msg05305.html
>> [4] 
>> http://svn.apache.org/repos/asf/tuscany/java/sca/modules/implementation-osgi/
>
>
> -- 
> Thanks, Dan Becker 


Re: [2.x] OSGi RFC 119 implemention using Tuscany Java SCA

Posted by Dan Becker <da...@gmail.com>.
Hi Raymond,

Fantastic job with both the presentation and the accompanying code.

I have one question. I see from the osgitest.composite that the service 
interface is referenced by the following element:
         <tuscany:implementation.osgi bundle="OSGiTestService" 
bundleSymbolicName="org.apache.tuscany.sca.implementation.osgi.test.OSGiTestInterface" 
/>

How is the bundle and bundleSymbolicName used to look up the bundle of 
the component service? Is this information enough to find the required 
service?

(P.S. Perhaps I missed the answer in the presentation, but this might be 
a useful question and answer for your PDF.)


Raymond Feng wrote:
> 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].
> 
> [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/dev@tuscany.apache.org/msg05305.html
> [4] 
> http://svn.apache.org/repos/asf/tuscany/java/sca/modules/implementation-osgi/ 
> 
> 


-- 
Thanks, Dan Becker