camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: a bit of stax
Date Fri, 13 May 2011 05:15:26 GMT

Yeah it does look very cool. Good work.

Would be great if the StaxComponent could also cater for non file
based inputs. You may have the message body as a Source already. But
that can always be improved.

And yes as Richard mention the class loading should use the
ClassResolver. You can get it from the CamelContext. exchange -> camel
context -> class resolver.

And the stuff that finds the annotations. We may have some common code
for that. Or later refactor that into a util class.

Anyway keep it up.

On Fri, May 13, 2011 at 1:29 AM, Richard Kettelerij
<> wrote:
> Hi Romain,
> Nice work. I've taken a look at your component. A few minor suggestions for
> improvement, in case you want to contribute it to Apache:
> - The component currently uses getContextClassLoader().loadClass() for
> classloading. Camel actually has a abstraction to make this portable across
> various runtime environments. You can just replace it with
> org.apache.camel.spi.ClassResolver().resolveClass().
> - Avoid catching the NullPointException in the StAXJAXBIteratorExpression.
> - Do you plan to add a DSL method for the StAXJAXBIteratorExpression
> (requires patching camel-core)? So you can write for example
> "split(stax(Record.class))" in your route.
> Regards,
> Richard
> On Thu, May 12, 2011 at 5:55 PM, Romain Manni-Bucau
> <>wrote:
>> Hi all,
>> i worked a bit around stax (thanks to claus for its advices).
>> You can find what i've done here:
>> The test show what can be done with it:
>>   - validation using sax (just need a converter)
>>   - parsing using a sax contenthandler and a stax stream reader (a simple
>>   component)
>>   - parsing of sub tree to get jaxb objects using a stax event reader for
>>   the whole tree and jaxb for the sub objects
>> - Romain

Claus Ibsen
CamelOne 2011:
Twitter: davsclaus
Author of Camel in Action:

View raw message