[ 
http://issues.apache.org/jira/browse/TUSCANY-610?page=comments#action_12427336 
] 
            
Joel Hawkins commented on TUSCANY-610:
--------------------------------------

Hi Thomas. 

I'm trying to write up some documentation now. In short, however, the code 
breaks down into 2 parts:

1. The OSGi hosting of the SCA core. This is a bundle that bootstraps SCA 
instances for bundles that have SCA components (scdl files). The host makes a 
distinction between system extension and applications. For example, the OSGi 
binding code that supports interacting with the OSGi service framework is 
packaged as a system extension. The samples are packaged as applications.  To 
me, these application instances feel like web apps.

2. The OSGi Services system extension, which in turn has two major parts:
   a. An OSGi Service binding, which allows SCA components to be exposed as 
OSGi services.  This is pretty straightforward. The only tricky bit (assuming 
away the intricacies of SCA's wiring) is dealing with the need for a 
ServiceFactory during service registration. This is added to the target class 
using a dynamic proxy if required.
   b. An OSGi implementation, which wraps OSGi services as SCA components, 
allowing them to be wire in seamlessly  (once I'm done :-) )into SCA 
applications.  This binding allows the specification of a filter for aquiring 
an appropriate service reference, and acts as a service listener to clean up 
stale references. The code currently attempts to rebind the service if the 
service has changed (using the same reference) or gone away (using a different 
reference). Not sure if this is desirable in all cases, but it gives good demo. 
:-)

Please remember this is an 'initial' implementation! There's enough code to get 
my simple scenarios working - but I'm sure there's plenty left to do. Also, the 
recent work that's been checked in to have some of the wiring handled by the 
wire service probably means some of this code can go away.

Some of the things I like about the combination of SCA and OSGi is that OSGi 
services provide a really simple and efficient way to communicate between SCA 
applications running in a single OSGi instance, and OSGi's bundle isolation 
characteristics make dealing with multiple application deployments much more 
"deterministic". From my perspective (having a toe dipped in both worlds), SCA 
and OSGi look really complementary.  

I'll also try and package the rest of my eclipse environment so that you can 
get this running. It's mostly bundle-izing the required Tuscany jars.








> Initial OSGi support effort
> ---------------------------
>
>                 Key: TUSCANY-610
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-610
>             Project: Tuscany
>          Issue Type: New Feature
>         Environment: Equinox implementation of OSGi
>            Reporter: Joel Hawkins
>         Attachments: ClassloaderHook.java, OSGI-SCA.zip
>
>
> An initial implementation of an OSGi binding for exposing SCA services as 
> OSGi services.
> An initial implementation of an OSGi implementation for reusing OSGi services 
> as SCA atomic components
> An OSGi-aware bootstrap environment (which can probably be reduced a bit)
> A repackaging of some of the SupplyChain example
> There's one class derived from an  EPL-copyrighted class - I left the EPL 
> copyright intact. 
> The zip contains the samples, the OSGi binding, and a patch for the core. 
> Most of the patch is the OSGi launcher code. I don't think it belongs in the 
> core, but that's where I had it while developing. The only other bit in the 
> patch is a change of two of the Defaultbootstrapper's fields from private to 
> protected.
> Also, some of the OSGi packaging for existing jars (spi, commands, etc) 
> aren't part of the zip. Not sure how you want to deal with the repackaging 
> issue.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to