Rajith, I said I'd reply to you if Raymond hadn't yet, so here goes. This
could all be not quite right as I'm not that much further on from you with
understanding how to use the databinding code, I'm sure Raymond will be able
to set things straight :)

The idea is that the binding or container doesn't have to care about the
databinding stuff and it can just assume that the objects it works with are
of the correct type that it can use.

Look at the Axis2 binding code which wants everything as AXIOM OMElements.
For the service the class is Axis2ServiceInOutSyncMessageReceiver
invokeBusinessLogic method which calls the  Axis2Service invokeTarget
method,  for the reference its the Axis2TargetInvoker invokeTarget method.
These are coded just to expect all the arguments and return objects are
OMElements. There's no code in the Axis2 binding for converting objects
from/to OMElements, thats all done in the databinding code.

The other part of this is in the Axis2BindingBuilder in the two build
methods sets the databinding type on the ServiceContract to
OMElement.class.getName(), and thats the same name which the AXIOM
databinding gets registered with in databinding-axiom project
org.apache.tuscany.databinding.axiom.AxiomDataBinding.

With all that in place the runtime will automatically call the databinding
framework to do any necessary type conversion. So for the JMS binding you
just have to set the default databinding you want to use in your builder and
then you service and reverence code can just assume the objects are of the
correct type.

Whats not completely clear to me is which databinding the JMS binding would
want to use. In the core project in
org.apache.tuscany.core.databinding.xmlthere's a DOMDataBinding but
using that your JMS binding code would still
need to to the (de)serialization of DOMs to/from xml Strings. There are
classes in that package to do this conversion to/from Strings but I'm not
sure how you say you want to use them. Maybe there needs to be a new
XMLStringDataBinding for you to use. We need Raymond to explain this bit.

  ...ant

On 9/26/06, Rajith Attapattu <[EMAIL PROTECTED]> wrote:

Hi,

I think I still haven't groked the full concept of the data binding
framework to get the full use of it.

Let me assume I have a service with a JMS binding. And  I serialize the
the
arguments as XML and send as a text message.
The operation name is captured in a JMS property as suggested by the spec.
So here is the flow. Assuming the components are deployed in 2 Tuscany
runtimes in different JVMs

[Component X --> Reference A with JMS binding]  ----- JMS message ---->
[Service A with JMS binding --> Component Y]

1. Now how can the JMSTargetInvoker leverage the databinding framework to
convert from the Object[] to the XML serialization?
   a) How can I invoke the interceptor chain ?
   b) How is the framework going to decide which serialization to use ?


2. When the service picks up the JMS message how can it leverage the db
framework to convert from XML to Object[] ?
  a)How can I invoke the interceptor chain again?
  b) How is the framework going to decide what is the expected format?

Sorry if the questions sound a bit trivial, but I think I am missing
something here which is preventing me from fully understanding the
framework.

Regards,

Rajith


Reply via email to