Return-Path: Delivered-To: apmail-ws-tuscany-dev-archive@locus.apache.org Received: (qmail 72063 invoked from network); 2 Jan 2008 13:29:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2008 13:29:02 -0000 Received: (qmail 76328 invoked by uid 500); 2 Jan 2008 13:28:50 -0000 Delivered-To: apmail-ws-tuscany-dev-archive@ws.apache.org Received: (qmail 76300 invoked by uid 500); 2 Jan 2008 13:28:50 -0000 Mailing-List: contact tuscany-dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-dev@ws.apache.org Delivered-To: mailing list tuscany-dev@ws.apache.org Received: (qmail 76291 invoked by uid 99); 2 Jan 2008 13:28:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 05:28:50 -0800 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [195.212.29.152] (HELO mtagate3.de.ibm.com) (195.212.29.152) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jan 2008 13:28:37 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id m02DSUDF158048 for ; Wed, 2 Jan 2008 13:28:30 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m02DSTT42035864 for ; Wed, 2 Jan 2008 14:28:29 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m02DSTYE031541 for ; Wed, 2 Jan 2008 14:28:29 +0100 Received: from [127.0.0.1] (dhcp-9-20-176-63.hursley.ibm.com [9.20.176.63]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m02DSSxG031524 for ; Wed, 2 Jan 2008 14:28:29 +0100 Message-ID: <477B917B.3030406@hursley.ibm.com> Date: Wed, 02 Jan 2008 13:28:27 +0000 From: Simon Nash Organization: IBM User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: tuscany-dev@ws.apache.org Subject: Re: Conversation from a non-SCA application References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Happy New Year to you as well! This is a very interesting use case. I could give you an answer based on the current Tuscany implementation, or I could give you an answer based on what the spec guarantees. I'll do the latter as this is the best way to ensure that the code you write will continue to work on future releases of Tuscany. The guaranteed approach would be to have a second client for the same service and have both clients force the same globally unique conversationID to be used when invoking the service. If the service is defined as having a callback, there's no way to avoid passing in a callback reference from the second client's invocation. However, the service can save away the original callback reference when it is first invoked by the original client, and can then use this callback reference to make the callback when it is invoked the second time (ignoring the callback reference passed with the second invocation). Here's the entire sequence of steps: 1) Conversational client calls a SCA Service Operation, specifying an explicit application-generated globally unique conversationID. This invocation will also pass an implicit callback reference to the original client. 2) SCA Service gets its callback reference (from the RequestContext) and saves it in its conversational state. The @Callback injection annotation should not be used. 3) SCA Service then makes a non-blocking call to the non-SCA operation, passing out the unique conversationID. This can be obtained via RequestContext.getServiceReference().getConversation().getConversationID() 4) non-SCA operation does its processing, then invokes a second SCA client passing the unique conversationID. 5) This second SCA client invokes the same SCA Service as in step 1, specifying the unique conversationID so that the same service component instance is used as in step 2. This invocation will also pass an implicit callback reference to the second client that is not useful and should be ignored by the SCA Service. 6) The SCA Service retrieves the callback reference that was saved in its conversational state in step 2, and uses this callback reference to return the updates to the original conversational client. Some notes on the above: a. Currently this would work in Tuscany even if step 5 invoked a different SCA Service in the same SCA Component. However, I can't find words in the spec that guarantee this. b. Currently this would work in Tuscany even if step 1 used a system- generated conversationID. However, I can't find words in the spec that guarantee this. Simon Dave Sowerby wrote: > Hi All, > > Seasons Greetings :) > > I've got a conversational service and it's client and it's all working great. > > However I'd like to extend this service to make a call to a non-SCA > asynchronous application and I'm not sure as to how I should make the > call back from the non-SCA application back into the SCA "world". > > Just to make sure this is all clear, the flow I'd like to achieve is: > > 1) Conversational client calls a SCA Service Operation. > 2) SCA Service then makes a non-blocking call to the non-SCA operation. > 3) non-SCA operation processes and notifies the originating Service > conversation-instance of updates. > 4) Any updates are returned to the original conversational client. > > Obviously the problem here is calling back into the originating > conversation-instance from the non-sca application. > > Looking through the various specifications from osoa I can't see any > suggested solutions to this, though I'm trying to ascertain if any of > the following would work: > > o invoke a second client (such as a Servlet) and force the > conversationID with no callback reference (to maintain the original > client callback reference). > o implement a second service through one component without callback > and once again force the conversationID to hopefully find the > originating service conversation-instance. > > Are either of these recommended solutions, or is there a more > appropriate means of doing this? I'd like to find a solution that > would continue to work between Tuscany releases. > > Any help would be greatly appreciated. > > Cheers, > > Dave. > --------------------------------------------------------------------- To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org For additional commands, e-mail: tuscany-dev-help@ws.apache.org