You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Vamsavardhana Reddy <c1...@gmail.com> on 2008/03/26 11:13:25 UTC

Adding conversational intents as described in the assembly spec

I started investigating TUSCANY-2112.  The approach I am taking is to make
something like the following work without having to annotate the java
interfaces with @Conversational etc.

    <component name="MyConvServiceComponent">
        <implementation.java class="
org.apache.tuscany.sca.mytest.MyConvServiceImpl"/>
        <service name="MyConvService" requires="sca:conversational">
            <interface.java interface="
org.apache.tuscany.sca.mytest.MyConvService"
                            callbackInterface="
org.apache.tuscany.sca.mytest.MyConvCallback"/>
            <operation name="endConversation"
requires="tuscany:endsConversation"/>
            <binding.ws/>
            <callback>
                <binding.ws/>
            </callback>
        </service>
    </component>
    <component name="MyConvClientComponent">
        <implementation.java class="
org.apache.tuscany.sca.mytest.MyConvClientImpl"/>
        <reference name="myConvService" target="MyConvServiceComponent"
requires="sca:conversational">
            <interface.java interface="
org.apache.tuscany.sca.mytest.MyConvService"
                            callbackInterface="
org.apache.tuscany.sca.mytest.MyConvCallback"/>
            <operation name="endConversation"
requires="tuscany:endsConversation"/>
            <binding.ws uri="/MyConvServiceComponent"/>
        </reference>
    </component>

I have tried some fix in Axis2ServiceBindingProvider and
Axis2ReferenceBindingProvider (where I noticed some TODO's) to set the
conversation related flags based on the intents.  But, then there seem to be
some other problems like the intents are not propagated to references etc,
for which I have created a JIRA.  Even though I set the flags explicitly
through the debugger by changing the values, I ended up with a
"pass-by-value not allowed" exception due to some object serialization
problems.  Appears like the intent processing should be done at higher level
than the bindings, perhaps when when the component instance is created!!

Some questions I have:
1. About setting endsConversation intent on callback methods.  The
<callback> tag does not seem to allow <operation> tags inside.  Should these
intents be set under <service> tag itself?  In this case we will need to
qualify the operation name so that it is recognized it is from callback
interface.
2. Should the callback interface be inheriting the intents from the
service?  Or should it be set on the callback instead?

Re: Adding conversational intents as described in the assembly spec

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Mar 26, 2008 at 10:13 AM, Vamsavardhana Reddy <c1...@gmail.com>
wrote:

> I started investigating TUSCANY-2112.  The approach I am taking is to make
> something like the following work without having to annotate the java
> interfaces with @Conversational etc.
>
>    <component name="MyConvServiceComponent">
>        <implementation.java class="
> org.apache.tuscany.sca.mytest.MyConvServiceImpl"/>
>        <service name="MyConvService" requires="sca:conversational">
>            <interface.java interface="
> org.apache.tuscany.sca.mytest.MyConvService"
>                            callbackInterface="
> org.apache.tuscany.sca.mytest.MyConvCallback"/>
>            <operation name="endConversation"
> requires="tuscany:endsConversation"/>
>            <binding.ws/>
>            <callback>
>                <binding.ws/>
>            </callback>
>        </service>
>    </component>
>    <component name="MyConvClientComponent">
>        <implementation.java class="
> org.apache.tuscany.sca.mytest.MyConvClientImpl"/>
>        <reference name="myConvService" target="MyConvServiceComponent"
> requires="sca:conversational">
>            <interface.java interface="
> org.apache.tuscany.sca.mytest.MyConvService"
>                            callbackInterface="
> org.apache.tuscany.sca.mytest.MyConvCallback"/>
>            <operation name="endConversation"
> requires="tuscany:endsConversation"/>
>            <binding.ws uri="/MyConvServiceComponent"/>
>        </reference>
>    </component>
>
> I have tried some fix in Axis2ServiceBindingProvider and
> Axis2ReferenceBindingProvider (where I noticed some TODO's) to set the
> conversation related flags based on the intents.  But, then there seem to
> be
> some other problems like the intents are not propagated to references etc,
> for which I have created a JIRA.  Even though I set the flags explicitly
> through the debugger by changing the values, I ended up with a
> "pass-by-value not allowed" exception due to some object serialization
> problems.  Appears like the intent processing should be done at higher
> level
> than the bindings, perhaps when when the component instance is created!!
>
> Some questions I have:
> 1. About setting endsConversation intent on callback methods.  The
> <callback> tag does not seem to allow <operation> tags inside.  Should
> these
> intents be set under <service> tag itself?  In this case we will need to
> qualify the operation name so that it is recognized it is from callback
> interface.
> 2. Should the callback interface be inheriting the intents from the
> service?  Or should it be set on the callback instead?


Hi Vamsi

The intent processing needs to be generic, i.e. not tied to the web service
bindings, if possible and applied to the interfaces described on services in
the assembly model. The objective is to have
org.apache.tuscany.sca.interfacedef.Interface.isConversational() return true
when the intent is present. However I note that against this method Raymond
has made the comment.

// FIXME: [rfeng] We need to re-consider the conversational as an intent

So the time is now nigh;-) Maybe it's the case that we flip this round and
introduce intents on the the services and references based on the settings
in either the

Java interface
Wsdl interface
intents in the composite file

And then check for these intents in the places that currently check for the
interface flags being set.

We need some advice from the policy experts as to where this kind of
processing could take place. It would seem to belong to the build phase but
we are talking about a very specific intent here so it's not generic
intent/policy processing.

You could go-ahead and create an itest (conversations-intent?) for these
policy driven cases so we can start running up a (non-)working example.

Regards

Simon