dev@fi.java.net

Re: JAXB and of base64 data and FI

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 26 Jul 2005 11:12:50 +0200

Kohsuke Kawaguchi wrote:
> Paul Sandoz wrote:
>
>> Hi Kohsuke,
>>
>> If you have some time this can we investigate using the FI base64
>> encoding algorithm to support the direct encoding/decoding of JAXB
>> base64 encoded data bound to byte[].
>>
>> This is not quite as complex as full advanced integration of FI. JWSDP
>> 1.6 supports direct encoding of bytes and it would be good to ensure
>> that the first integration of FI in JAX-WS has the same functionality.
>>
>> I can see how one might implement this for serialization but and i
>> little stuck on the best approach for parsing.
>
>
> Sure, we can work on this.
>
> A lot of details has slipped me since we talked about this last time.
> But I believe all the relevant code are already in place.
>
> There can be FiXmlOutput implementation, and then in the text method we
> can look for the Base64Data object as a parameter.
>

OK so we check for:

if (o instanceof Base64Data)


> Similarly we need an "FIConnector" class that fires event to XmlVisitor.
> You can pass a Base64Data object to the text method for the raw binary
> data.
>

OK.


> For applications to pass the FI parser into JAXB through the JAXB API,
> we can have FISource and FIResult class. We can extend them from
> SAXSource/Result for compatibility with non FI-aware systems. We can
> then code the JAXB RI so that it invokes those FIConnector and
> FIXmlOutput instead of treating it as a regular SAXSource/Result.
>

We already have FastInfosetSource [1] and FastInfosetResult [2], which
is part of the FastInfoset.jar.

One issue is that JAX-WS uses StAX so the FI StAX parser and serializer
will be used. So the source and result are not really SAX based. This
may make the returning of a Base64Data a little tricky as we go through
a pull to push layer. To encode and decode such data we may need to
operate closely with the StAX serializer and parser.

For parsing we might need to do something at the level of the
XMLStreamReaderToContentHandler or have something specific to FI related
to StAX. Or can we have a FIStAXConnector?


> If someone from the FI team can write those code, I can happy put them
> into the JAXB CVS repository and modify our API implementation code to
> hook them together.
>

Are you just referring to the source/result or are you including the
FIConnector and FIXmlOutput as well?

>
> In the past we talked a lot about making those FIConnector/FIXmlOutput
> super fast (such as index sharing etc), but I think your suggestion of
> "let's have something that works and improve it over time" makes sense.
>

Yeh, my eyes are bigger than my stomach!

Paul.

[1]
https://fi.dev.java.net/source/browse/fi/FastInfoset/src/org/jvnet/fastinfoset/FastInfosetSource.java?rev=1.1&view=auto&content-type=text/vnd.viewcvs-markup
[2]
https://fi.dev.java.net/source/browse/fi/FastInfoset/src/org/jvnet/fastinfoset/FastInfosetResult.java?rev=1.1&view=auto&content-type=text/vnd.viewcvs-markup

P.S. Using Fisheye would be better :-)

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109