使用 Spring Framework 设计和开发 SCA 组件,第 2 部分: 使用 Apache Tuscany 的高级技巧
2010-02-25 00:00:00 来源:WEB开发网清单 4. calculator.composite
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
targetNamespace="http://calc"
xmlns:c="http://calc"
name="Calculator">
<service name="CalculatorService" promote=”CalculatorComponent">
<interface.java interface="calculator.CalculatorService"/>
<t:binding.rmi host="localhost" port="8099" serviceName="CalculatorRMIService"/>
</service>
<component name="CalculatorComponent">
<implementation.spring location="META-INF/spring/calculator-context.xml"/>
<reference name="addService" target="AddComponent" />
<reference name="subtractService" target="SubtractComponent" />
<reference name="multiplyService" target="MultiplyComponent"/>
<reference name="divideService" target="DivideComponent" />
<property name="message">HelloWorld</property>
</component>
<component name="AddComponent">
<t:implementation.script script="calculator/AddServiceImpl.js"/>
</component>
<component name="SubtractComponent">
<implementation.java class="calculator.SubtractServiceImpl"/>
</component>
<component name="MultiplyComponent">
<implementation.java class="calculator.MultiplyServiceImpl"/>
</component>
<component name="DivideComponent">
<t:implementation.script script="calculator/DivideServiceImpl.groovy"/>
</component>
</composite>
更多精彩
赞助商链接