Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
sca-contribution.xml
sca-contribution.xml

...

3

...

META-INF/sca-contribution.xml defines the deployable composites for the given SCA contribution (the WAR in the webapp case). Tuscany servlet filter will bootstrap the SCA domain and deploy these composites.

...

. The sample scenario

3.1 SCA composites

3.1

...

Code Block
2xml
titleMETA-INF/calculator.composite
borderStylesolid

<?xml version="1.0" encoding="UTF-8"?>
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
              targetNamespace="http://sample"
              xmlns:sample="http://sample">
   <deployable composite="sample:Calculator"/>
</contribution>

2.4 SCA composites

...

.1 binding.ws

 
The  Calculator.composite is one such deployable sca composite and is defined as follows.

...

Code Block
2xml
titleCalculator.composite
borderStylesolid
<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
           targetNamespace="http://sample"
           xmlns:sample="http://sample"
           name="Calculator">

    <component name="CalculatorServiceComponent">
		<implementation.java class="calculator.CalculatorServiceImpl"/>
        <reference name="addService" >
           <interface.java interface="calculator.AddService" />
            <binding.ws uri="http://localhost:8080/sample-calculator-ws-webapp/AddServiceComponent"/>
        </reference>
        <reference name="subtractService" target="SubtractServiceComponent"></reference>
        <reference name="multiplyService" target="MultiplyServiceComponent"></reference>
        <reference name="divideService" target="DivideServiceComponent"></reference>
    </component>

    <component name="AddServiceComponent">
        <implementation.java class="calculator.AddServiceImpl"/>
        <service name="AddService">
             <interface.java interface="calculator.AddService" />
            <binding.ws/>
        </service>
    </component>

    <component name="SubtractServiceComponent">
        <implementation.java class="calculator.SubtractServiceImpl"/>
    </component>

    <component name="MultiplyServiceComponent">
        <implementation.java class="calculator.MultiplyServiceImpl"/>
    </component>

    <component name="DivideServiceComponent">
        <implementation.java class="calculator.DivideServiceImpl"/>
    </component>

</composite>

3.2 sca-contribution.xml

META-INF/sca-contribution.xml defines the deployable composites for the given SCA contribution (the WAR in the webapp case). Tuscany servlet filter will bootstrap the SCA domain and deploy these composites.

Anchor
META-INF/sca-contribution.xml
META-INF/sca-contribution.xml

Code Block
2xml
titleMETA-INF/calculator.composite
borderStylesolid

<?xml version="1.0" encoding="UTF-8"?>
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
              targetNamespace="http://sample"
              xmlns:sample="http://sample">
   <deployable composite="sample:Calculator"/>
</contribution>

4. Devloping a Tuscany web application for Geronimo using Maven and Eclipse

...

4.1 Create an empty maven project for your web application

Code Block
mvn archetype:generate

...

Code Block
mvn eclipse:eclipse

...

4.2 Import the project into Eclipse

In Eclipse, following the menu: File -> Import -> General --> Exising Projects into Workspace.

4.3. Configure the maven pom.xml to generate web.xml and geronimo-web.xml automatically

Tuscany provides a maven which can generate the WEB-INF/web.xml and WEB-IN/geronimo-web.xml automatically as part of the maven build. The following xml snippet shows
the usage.

...