DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
OSGi RFC 119 Implementation
- OSGi 4.2 Early Drfat 3
- Distributed OSGi discussion on Tuscany Dev ML
- A high level design note for the RFC 119 implementation with Tuscany/SCA
The Distributed Calculator Scenario
The calculator.dosgi bundle
http://svn.apache.org/repos/asf/tuscany/java/sca/samples/dosgi-calculator/
META-INF/MANIFEST.MF
Manifest-Version: 1.0 Export-Package: calculator.dosgi;version="1.0.0", calculator.dosgi.operations;version="1.0.0" Bundle-Version: 1.0.0 Bundle-Name: calculator.dosgi Bundle-Activator: calculator.dosgi.CalculatorActivator Bundle-ManifestVersion: 2 Import-Package: calculator.dosgi.operations;version="1.0.0", org.osgi.framework, org.osgi.service.packageadmin, org.osgi.util.tracker, org.osgi.service.component;resolution:=optional Bundle-SymbolicName: calculator.dosgi Bundle-Vendor: The Apache Software Foundation Bundle-ActivationPolicy: lazy Eclipse-LazyStart: true Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt Bundle-DocURL: http://www.apache.org/ Service-Component: OSGI-INF/calculator-component.xml
The SCA component type definition: OSGI-INF/sca/bundle.componentType
<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
<!-- The service elment defines an SCA view of the OSGi service -->
<service name="Calculator">
<!-- The interface will be mapped into the OSGi service class -->
<interface.java interface="calculator.dosgi.CalculatorService"/>
<!-- The list of OSGi properties -->
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</service>
<!-- The reference elment defines an SCA proxy to a remote OSGi service -->
<reference name="addService">
<interface.java interface="calculator.dosgi.operations.AddService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</reference>
<reference name="subtractService">
<interface.java interface="calculator.dosgi.operations.SubtractService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</reference>
<reference name="multiplyService">
<interface.java interface="calculator.dosgi.operations.MultiplyService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</reference>
<reference name="divideService">
<interface.java interface="calculator.dosgi.operations.DivideService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</reference>
</componentType>
The SCA composite definition: OSGI-INF/sca/bundle.composite
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://calculator.dosgi"
name="CalculatorComposite">
<component name="CalculatorComponent">
<tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
<reference name="addService">
<tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
</reference>
<reference name="subtractService">
<tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
</reference>
<reference name="multiplyService">
<tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
</reference>
<reference name="divideService">
<tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
</reference>
</component>
</composite>
The calculator.dosgi.operations bundle
https://svn.apache.org/repos/asf/tuscany/java/sca/samples/dosgi-calculator-operations/
META-INF/MANIFEST.MF
Manifest-Version: 1.0 Export-Package: calculator.dosgi.operations;version="1.0.0" Bundle-Version: 1.0.0 Bundle-Name: calculator.dosgi.operations Bundle-Activator: calculator.dosgi.operations.OperationsActivator Bundle-ManifestVersion: 2 Import-Package: calculator.dosgi.operations;version="1.0.0", org.osgi.framework, org.osgi.service.component;resolution:=optional Bundle-SymbolicName: calculator.dosgi.operations Bundle-Vendor: The Apache Software Foundation Bundle-ActivationPolicy: lazy Eclipse-LazyStart: true Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt Bundle-DocURL: http://www.apache.org/ Service-Component: OSGI-INF/add-component.xml, OSGI-INF/subtract-component.xml, OSGI-INF/multiply-component.xml, OSGI-INF/divide-component.xml
The SCA component type definition: OSGI-INF/sca/bundle.componentType
<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
<!-- The service elment defines an SCA proxy to a remote OSGi service -->
<service name="AddService">
<interface.java interface="calculator.dosgi.operations.AddService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</service>
<service name="SubtractService">
<interface.java interface="calculator.dosgi.operations.SubtractService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</service>
<service name="MultiplyService">
<interface.java interface="calculator.dosgi.operations.MultiplyService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</service>
<service name="DivideService">
<interface.java interface="calculator.dosgi.operations.DivideService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</service>
</componentType>
The SCA composite definition: OSGI-INF/sca/bundle.composite
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://calculator.dosgi"
name="OperationsComposite">
<component name="OperationsComponent">
<tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
<service name="AddService">
<tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
</service>
<service name="SubtractService">
<tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
</service>
<service name="MultiplyService">
<tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
</service>
<service name="DivideService">
<tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
</service>
</component>
</composite>
Tuscany/SCA modules related to RFC 119
- implementation-osgi module
This module contains the java model for <implementation.osgi> and XML processors to load/save related XML document
- implementation-osgi-runtime module
This module contains the implementation provider for implementation.osgi
- contribution-osgi module
This module contains the contribution processing code that handles the OSGi bundles as SCA contributions
- node-impl-osgi module
This module listens on the OSGi bundles that are SCA enabled. It builds a Tuscany SCA node to run the composite application.
