You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Wouter Horré <wo...@cs.kuleuven.be> on 2009/02/24 16:06:23 UTC

Support for extended attributes incomplete?

Hi,

I am trying to extend the Tuscany xml processing with an extension to
process an extra attribute. I created a processor that implements
StAXAttributeProcessor, but when I try to use that, I get a
ClassCastException at BaseAssemblyProcessor:873. This code casts the
return value of my StAXAttributeProcessor to String ...

I am using Tuscany 1.4, but as far as I can see, this code is the same
in the 2.x SVN.

Can somebody please provide some details on the state of extended
attributes?

best regards
Wouter Horré



Re: Support for extended attributes incomplete?

Posted by Wouter Horré <wo...@cs.kuleuven.be>.
On Thu, 2009-02-26 at 08:09 -0800, Luciano Resende wrote:
> On Thu, Feb 26, 2009 at 7:28 AM, Wouter Horré
> <wo...@cs.kuleuven.be> wrote:
> > Hi,
> >
> > Thanks for your clarification. I tried with 1.x from svn and I got it
> > working now.
> >
> > One more question: the write method on my processor is never called. I
> > had to implement toString() on my model classes to get it working. Is
> > this intended behavior?
> 
> How are you testing the write method ? If you adapt the
> testReadWriteCompositeWithAttributeProcessor test [1] to use your own
> processor, does the write method gets called ? Note that this method
> is only supposed to be called when you try to write the composite back
> to a file.

I found the problem. It was my fault. I did not extend the Extension
interface ...

Thanks for your help
Wouter


Re: Support for extended attributes incomplete?

Posted by Luciano Resende <lu...@gmail.com>.
On Thu, Feb 26, 2009 at 7:28 AM, Wouter Horré
<wo...@cs.kuleuven.be> wrote:
> Hi,
>
> Thanks for your clarification. I tried with 1.x from svn and I got it
> working now.
>
> One more question: the write method on my processor is never called. I
> had to implement toString() on my model classes to get it working. Is
> this intended behavior?

How are you testing the write method ? If you adapt the
testReadWriteCompositeWithAttributeProcessor test [1] to use your own
processor, does the write method gets called ? Note that this method
is only supposed to be called when you try to write the composite back
to a file.


[1] https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteAnyAttributeTestCase.java


-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Re: Support for extended attributes incomplete?

Posted by Wouter Horré <wo...@cs.kuleuven.be>.
Hi,

Thanks for your clarification. I tried with 1.x from svn and I got it
working now.

One more question: the write method on my processor is never called. I
had to implement toString() on my model classes to get it working. Is
this intended behavior?

regards
Wouter

On Tue, 2009-02-24 at 08:03 -0800, Luciano Resende wrote:
> This has been fixed in the 1.x trunk code, and we now have a Extension
> model object that wraps the extended attribute model. An example of a
> processor is available in the assembly-xml test case. Most of this
> code should be already merged/ported to 2.x as well.
> 
> On Tue, Feb 24, 2009 at 7:06 AM, Wouter Horré
> <wo...@cs.kuleuven.be> wrote:
> > Hi,
> >
> > I am trying to extend the Tuscany xml processing with an extension to
> > process an extra attribute. I created a processor that implements
> > StAXAttributeProcessor, but when I try to use that, I get a
> > ClassCastException at BaseAssemblyProcessor:873. This code casts the
> > return value of my StAXAttributeProcessor to String ...
> >
> > I am using Tuscany 1.4, but as far as I can see, this code is the same
> > in the 2.x SVN.
> >
> > Can somebody please provide some details on the state of extended
> > attributes?
> >
> > best regards
> > Wouter Horré
> >
> >
> >
> 
> 
> 


Re: Support for extended attributes incomplete?

Posted by Luciano Resende <lu...@gmail.com>.
This has been fixed in the 1.x trunk code, and we now have a Extension
model object that wraps the extended attribute model. An example of a
processor is available in the assembly-xml test case. Most of this
code should be already merged/ported to 2.x as well.

On Tue, Feb 24, 2009 at 7:06 AM, Wouter Horré
<wo...@cs.kuleuven.be> wrote:
> Hi,
>
> I am trying to extend the Tuscany xml processing with an extension to
> process an extra attribute. I created a processor that implements
> StAXAttributeProcessor, but when I try to use that, I get a
> ClassCastException at BaseAssemblyProcessor:873. This code casts the
> return value of my StAXAttributeProcessor to String ...
>
> I am using Tuscany 1.4, but as far as I can see, this code is the same
> in the 2.x SVN.
>
> Can somebody please provide some details on the state of extended
> attributes?
>
> best regards
> Wouter Horré
>
>
>



-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/