|
Size: 4492
Comment: typo fix
|
← Revision 3 as of 2009-09-20 22:47:41 ⇥
Size: 4492
Comment: converted to 1.6 markup
|
| No differences found! | |
Support for Async Callbacks
Async callbacks allow a component to perform a request on another component and to receive its response asynchronously via a callback. This feature follows the programming model specified in the SCA Client and Implementation Model for Java (found in http://osoa.org/display/Main/Service+Component+Architecture+Specifications).
Currently, async callbacks are supported for components wired via bindless references, and via references with a web services binding using Axis2 (WS/Axis2).
Async Callbacks via Bindless References
In this mode, a source component uses a reference that does not include a binding, which is then wired to a target component via a service that does not include a binding either. For an example, see the inner.composite sample. To illustrate, an excerpt of the SCDLs for the inner.composite sample is as follows:
Source Composite
Contained in InnerComposite.scdl
<component name="InnerSourceComponent">
<implementation.java class="innercomposite.SourceImpl"/>
<reference name="targetReference">TargetComponentRef</reference>
</component>
<reference name="TargetComponentRef">
<interface.java interface="innercomposite.Target"
callbackInterface="innercomposite.SourceCallback"/>
</reference>
Target Composite
Contained in InnerComposite2.scdl
<service name="InnerTargetService" target="InnerTargetComponent">
<interface.java interface="innercomposite.Target"
callbackInterface="innercomposite.SourceCallback"/>
<reference name="innerSource">InnerTargetComponent</reference>
</service>
<component name="InnerTargetComponent">
<implementation.java class="innercomposite.TargetImpl"/>
</component>
Containing Composite
Contained in default.scdl
<component name="SourceComponent">
<implementation.composite name="InnerComposite" scdlLocation="InnerComposite.scdl"/> <reference name="TargetComponentRef2">TargetComponent2</reference>
</component>
<component name="TargetComponent2">
<implementation.composite name="InnerComposite2" scdlLocation="InnerComposite2.scdl"/>
</component>
Async Callbacks via WS/Axis2 Binding
In this mode, the reference and service used by the source and target components use a WS/Axis2 binding (<binding.ws/>). For an example, see the helloworldws-async and helloworldwsclient-async samples. A preview of the SCDLs is as follows:
Server side
<service name="HelloWorldWebService" target="http:///foo">
<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)"
conformanceURIs="http://ws-i.org/profiles/basic/1.1" location="wsdl/helloworld.wsdl" />
<reference>HelloWorldServiceComponent</reference>
</service>
<component name="HelloWorldServiceComponent">
<implementation.java class="helloworld.HelloWorldImpl" />
</component>
Client side
<component name="HelloWorldServiceComponent">
<implementation.java class="helloworld.HelloWorldServiceComponent"/> <reference name="helloWorldService">HelloWorldService</reference>
</component>
<reference name="HelloWorldService">
<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>
Limitations
Currently, async callbacks over WS/Axis2 has the following limitations:
- The callback interface can only use a single method
- The WSDL definition in use must include a port type that describes the callback interface separately, see resources/META-INF/wsdl/helloworld.wsdl