dev@fi.java.net

Re: JAXB Hook for FI

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 11 May 2005 08:32:18 -0700

Paul Sandoz wrote:
> Kohsuke Kawaguchi wrote:
>> Paul Sandoz wrote:
>>
>>> One of the general problems we will have to tackle is the push me pull
>>> me creature that is JAX-RPC + JAXB. JAX-RPC processing of SOAP
>>> messages is done using a pull model. I could write a rather odd parser
>>> that allows for a pull model via StAX for JAX-RPC to process the SOAP
>>> message infoset and a push model for JAXB to process the content of
>>> the SOAP message (header blocks, body and fault detail children).
>>
>>
>> When the JAXB RI accepts a StAX parser as an input, we internally run
>> the 'message pump' that peeks the next event and send it into this
>> interface. I think this is easier to manage, rather than to mix pull and
>> push both into the same FI parser class. Any reason why this isn't
>> desirable?
>>
>
> Just that i do not like addition layers :-) plus i am also finding that
> the FI StAX implementation is slower than the FI SAX implementation, i
> do not know the precise reason but think it is because there is better
> hotspot optimization because SAX controls the loop.
>
> We would also have to make sure that the optimized data gets passed
> through correctly.
>
>
>> On a different note, I added IntArrayData. This can be passed to
>> XmlVisitor.text.
>>
>
> OK.
>
> I see you have written a conversion routine to characters. The code for
> the builtin encoding algorithms has conversion to text, i am wondering
> if we can reuse this code.

We don't really expect toString or any of those CharSequence
implementations to be used in a normal situation, so I think slower code
is OK.

But if the code you have in the FI is something we can copy easily, that
would be good.

>> One thing the current XmlVisitor doesn't do well is the attributes. It
>> relies on SAX's definition, so we can only pass String, not
>> CharSequence. This has been OK for the MTOM support, but I guess it's
>> not good for FI. Should I be changing this to something else?
>>
>
> FI supports an extended interface to get access to optimized data. So it
> would be necessary to cast to this interface and check if there is
> optimized data present.

Which interface is that? I'd like to take a look.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com