Issue Details (XML | Word | Printable)

Key: TUSCANY-610
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Joel Hawkins
Votes: 0
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Tuscany

Initial OSGi support effort

Created: 09/Aug/06 04:19 PM   Updated: 19/Dec/07 12:33 AM
Return to search
Component/s: Java SCA OSGi Integration
Affects Version/s: None
Fix Version/s: Java-SCA-1.0

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works ClassloaderHook.java 2006-08-10 07:17 PM Joel Hawkins 2 kB
Zip Archive OSGI-SCA.zip 2006-08-09 04:19 PM Joel Hawkins 81 kB
Environment: Equinox implementation of OSGi

Patch Info: Patch Available
Resolution Date: 18/Aug/07 03:20 AM


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Thomas Watson added a comment - 10/Aug/06 01:59 PM
Joel,

Is there some more documentation on this work? I do not know much about how SCA works but I would like to see how this fits into the OSGi environment. Can you provide some steps to get this running on Equinox? Any other information on how SCA and OSGi can interact with each other would also be interesting to me.

Thanks. Tom.

P.S. I'm a developer on the Equinox Framework team. Please let us know if you need any assistence from the Equinox team to advance this work (bug fixes, enhancements, questions etc.).

Joel Hawkins added a comment - 10/Aug/06 07:17 PM
Hi Jim,

You can remove the AbstractReflector class from org.apache.tuscany.osgi.core.impl and replace the old ClassLoaderHook class with this attachment. That should take care of the EPL issue.

Joel Hawkins added a comment - 10/Aug/06 08:06 PM
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.







Nicole Wengatz added a comment - 15/Aug/06 11:03 AM
Hi Joel,

are you working with the Tuscany M1 release?

After importing your projects in Eclipse, I have some problems to find the required classes.
The OSGiBinding class f.e. extends Binding, but I find only an interface Binding
(org.apache.tuscany.model.assembly.Binding).

Could you please send me (or link me to) the required classes?

Thanks
Nicole

Joel Hawkins added a comment - 17/Aug/06 09:10 PM
Hi Jim,

I think I'll have some cycles to devote to this code shortly - is there anything I can do to help with the initial commit?

Cheers,
Joel

Jean-Sebastien Delfino added a comment - 18/Aug/07 03:20 AM
I think this one has been resolved, since there is support for OSGI implementations and bindings now. Please reopen it if you think otherwise, or even better reopen new JIRAs with new specific issues or new patches as necessary. Thanks.

Simon Laws added a comment - 19/Dec/07 12:33 AM
Assign to 1.0 during tidy up prior to 1.1