You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Fabio Albani <qu...@gmail.com> on 2010/12/31 12:46:54 UTC

a big problem with databinding and passing of Java Objects

Hi to all,
I've developed some extension tu Tuscany for my master degree, expecially a
new interface and implementation.
 I've developed transformators creating a new data-binding for converting
ASM Value to Java Object and viceversa.

My problem is, even if I've set my ASMImplementationInvoker as a
DataTypesomething, so having to override the method
isAllowsPassByReference() (cause in my implementation I've not defined an
annotation for doing this), the Java objects passed between different
components implemented in the technology I've added, Tuscany runtime tries
to serialized the with JAXB, causing an error.

My question is: how can I force that passing by reference and not value?
What I've to set? Or, how can I override this JAXB problem and convert them
with other types, for example SDO?

Thanks in advance.

Fabio

Re: a big problem with databinding and passing of Java Objects

Posted by Simon Nash <na...@apache.org>.
Fabio Albani wrote:
> Yes, probably the problem is that I used a remotable interface... I've 
> already created my own databinding, which contains transformation to and 
> from Java Objects, so the problem is that is  executed Output2Output 
> trasformation which tries to serialize the Object, and not copy the 
> reference, even if is set "allows pass with reference".
> 
I'm not sure why your "allowsPassByReference" override isn't doing what
you expect.  It might be useful to step through the code in a debugger
to see what's happening.

However, even if this approach could be made to work, I'm not convinced
that it's providing the correct SCA semantics.  If the interface is
remotable, this means that the data passed across the interface must
be able to be passed remotely, which means it must be able to be
serialized and deserialized by the databinding transformers.  The
"allowsPassByReference" setting is an optimization hint to the Tuscany
runtime to avoid this serialization if the invocation happens to be local.
If the invocation is remote, the data needs to be serialized.  So if your
databinding is intended for use with remotable interfaces (i.e., on
invocations that might be remote), then it needs to provide the
necessary transformers to support serialization and deserialization.

   Simon

> Fabio
> 
> 2011/1/2 Giorgio Zoppi <giorgio.zoppi@gmail.com 
> <ma...@gmail.com>>
> 
>     Ciao Fabio,
>     You might create your own databinding.
> 
> 
>     2010/12/31 Fabio Albani <quintusfabius@gmail.com
>     <ma...@gmail.com>>:
>      > Hi to all,
>      > I've developed some extension tu Tuscany for my master degree,
>     expecially a
>      > new interface and implementation.
>      >  I've developed transformators creating a new data-binding for
>     converting
>      > ASM Value to Java Object and viceversa.
>      > My problem is, even if I've set my ASMImplementationInvoker as a
>      > DataTypesomething, so having to override the method
>      > isAllowsPassByReference() (cause in my implementation I've not
>     defined an
>      > annotation for doing this), the Java objects passed between different
>      > components implemented in the technology I've added, Tuscany
>     runtime tries
>      > to serialized the with JAXB, causing an error.
>      > My question is: how can I force that passing by reference and not
>     value?
>      > What I've to set? Or, how can I override this JAXB problem and
>     convert them
>      > with other types, for example SDO?
>      > Thanks in advance.
>      > Fabio
> 
> 
> 
>     --
>     Quiero ser el rayo de sol que cada día te despierta
>     para hacerte respirar y vivir en me.
>     "Favola -Moda".
> 
> 


Re: a big problem with databinding and passing of Java Objects

Posted by Fabio Albani <qu...@gmail.com>.
Yes, probably the problem is that I used a remotable interface... I've
already created my own databinding, which contains transformation to and
from Java Objects, so the problem is that is  executed Output2Output
trasformation which tries to serialize the Object, and not copy the
reference, even if is set "allows pass with reference".

Fabio

2011/1/2 Giorgio Zoppi <gi...@gmail.com>

> Ciao Fabio,
> You might create your own databinding.
>
>
> 2010/12/31 Fabio Albani <qu...@gmail.com>:
> > Hi to all,
> > I've developed some extension tu Tuscany for my master degree, expecially
> a
> > new interface and implementation.
> >  I've developed transformators creating a new data-binding for converting
> > ASM Value to Java Object and viceversa.
> > My problem is, even if I've set my ASMImplementationInvoker as a
> > DataTypesomething, so having to override the method
> > isAllowsPassByReference() (cause in my implementation I've not defined an
> > annotation for doing this), the Java objects passed between different
> > components implemented in the technology I've added, Tuscany runtime
> tries
> > to serialized the with JAXB, causing an error.
> > My question is: how can I force that passing by reference and not value?
> > What I've to set? Or, how can I override this JAXB problem and convert
> them
> > with other types, for example SDO?
> > Thanks in advance.
> > Fabio
>
>
>
> --
> Quiero ser el rayo de sol que cada día te despierta
> para hacerte respirar y vivir en me.
> "Favola -Moda".
>

Re: a big problem with databinding and passing of Java Objects

Posted by Giorgio Zoppi <gi...@gmail.com>.
Ciao Fabio,
You might create your own databinding.


2010/12/31 Fabio Albani <qu...@gmail.com>:
> Hi to all,
> I've developed some extension tu Tuscany for my master degree, expecially a
> new interface and implementation.
>  I've developed transformators creating a new data-binding for converting
> ASM Value to Java Object and viceversa.
> My problem is, even if I've set my ASMImplementationInvoker as a
> DataTypesomething, so having to override the method
> isAllowsPassByReference() (cause in my implementation I've not defined an
> annotation for doing this), the Java objects passed between different
> components implemented in the technology I've added, Tuscany runtime tries
> to serialized the with JAXB, causing an error.
> My question is: how can I force that passing by reference and not value?
> What I've to set? Or, how can I override this JAXB problem and convert them
> with other types, for example SDO?
> Thanks in advance.
> Fabio



-- 
Quiero ser el rayo de sol que cada día te despierta
para hacerte respirar y vivir en me.
"Favola -Moda".

Re: a big problem with databinding and passing of Java Objects

Posted by Simon Nash <na...@apache.org>.
Fabio Albani wrote:
> Hi to all,
> I've developed some extension tu Tuscany for my master degree, 
> expecially a new interface and implementation. 
>  I've developed transformators creating a new data-binding for 
> converting ASM Value to Java Object and viceversa.
> 
> My problem is, even if I've set my ASMImplementationInvoker as a 
> DataTypesomething, so having to override the method 
> isAllowsPassByReference() (cause in my implementation I've not defined 
> an annotation for doing this), the Java objects passed between different 
> components implemented in the technology I've added, Tuscany runtime 
> tries to serialized the with JAXB, causing an error.
> 
> My question is: how can I force that passing by reference and not value? 
> What I've to set? Or, how can I override this JAXB problem and convert 
> them with other types, for example SDO?
> 
> Thanks in advance.
> 
> Fabio
 >
Is the service interface local or remotable?  If it is local, there
should be no copying.

   Simon