Wiring
Component connectivity is handled through "Wiring," which implies defining source/target information between Components. As with other SCA elements, the details of Wiring can be set declaratively. SCA Wiring does not require the source and targets to be of the same type (Java interfaces to WSDL is acceptable, for instance) as long as compatibility concerns such as remoteability, callback support, Fault, and Exception handling are addressed. Example 3(a) is a simple wiring example.
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="CalculatorComposite"> <service name="CalculatorService"> <interface.java interface="calculator.CalculatorService"/> <reference>CalculatorServiceComponent</reference> </service> <component name="CalculatorServiceComponent"> <implementation.java class="calculator.CalculatorServiceImpl"/> <reference name="addService">AddServiceComponent</reference> ... </component> <component name="AddServiceComponent"> <implementation.java class="calculator.AddServiceImpl"/> </component> ... </composite>
(a) <reference name="stockQuoteService" target="StockQuoteMediatorComponent"/> (b) <reference name="HelloWorldService"> <interface.java interface="helloworld.HelloWorldService" callbackInterface="helloworld.HelloWorldCallback"/> <interface.wsdl xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance" interface="http://helloworld#wsdl.interface(HelloWorld)" callbackInterface="http://helloworld#wsdl.interface(HelloWorldCallback)" wsdli:wsdlLocation="http://helloworld wsdl/helloworld.wsdl" /> <binding.ws endpoint= "http://helloworld#wsdl.endpoint(HelloWorldService/HelloWorldSoapPort)" location="wsdl/helloworld.wsdl" /> </reference>
To simplify development, SCA supports "Autowiring." As long as References are unambiguous, the container should be capable of wiring components at runtime.