You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by timactive <rd...@timactive.com> on 2013/05/13 10:47:27 UTC
camel-stax use a custom bean handler not a class
Hi,
I have a generic bean handler(extend DefaultHandler), this bean need a param
to work correctly such as
the nodeRoot, nodeItem etc..
I want use this bean with camel-stax but i think is not possible :
<route>
<from uri="file:/tmp/inbox"/>
<to uri="stax:orderHandler" />
</route>
<bean id="orderHandler" class="com.timactive.article.ArticleHandlerMapper">
<property name="nodeRoot" value="ORDERS"></property>
<property name="nodeItem" value="ORDER"></property>
</bean>
In the documentation of camel-stax http://camel.apache.org/stax.html, the
exemple propose just to pass a class handler, not a bean?
how would someone do this kind of process?
--
View this message in context: http://camel.465427.n5.nabble.com/camel-stax-use-a-custom-bean-handler-not-a-class-tp5732395.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-stax use a custom bean handler not a class
Posted by timactive <rd...@timactive.com>.
Hi Romain,
cool!! thank, i test this now!!!
Le 13/05/2013 15:33, Romain Manni-Bucau [via Camel] a écrit :
> Hi
>
> created https://issues.apache.org/jira/browse/CAMEL-6356
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog:
> **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/5/13 timactive <[hidden email]
> </user/SendEmail.jtp?type=node&node=5732405&i=0>>
>
> > Thank Claus.
> > Indeed, the code source camel-stax say :
> > In processor
> > ContentHandler handler = contentHandlerClass.newInstance();
> > In Component
> > processor.setContentHandler(getCamelContext().getClassResolver(),
> > remaining);
> >
> > So it is not possible actually.
> >
> > I am currently discussing with Romain Manni-Bucau, the developer of the
> > component.
> > But let's say I just finished the Camel documentation, so I'm a
> novice. But
> > I think it happen.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/camel-stax-use-a-custom-bean-handler-not-a-class-tp5732395p5732400.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the
> discussion below:
> http://camel.465427.n5.nabble.com/camel-stax-use-a-custom-bean-handler-not-a-class-tp5732395p5732405.html
>
> To unsubscribe from camel-stax use a custom bean handler not a class,
> click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5732395&code=cmRldmVyYUB0aW1hY3RpdmUuY29tfDU3MzIzOTV8MTIzMTAwMTY1OA==>.
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
timactive.com <http://www.timactive.com/>
Romain De Véra
*Développeur/Architecte Web | Timactive*
06.38.39.75.08
rdevera@timactive.com <ma...@timactive.com>
logo200X95.png (14K) <http://camel.465427.n5.nabble.com/attachment/5732409/0/logo200X95.png>
tel.png (670 bytes) <http://camel.465427.n5.nabble.com/attachment/5732409/1/tel.png>
mail.gif (82 bytes) <http://camel.465427.n5.nabble.com/attachment/5732409/2/mail.gif>
--
View this message in context: http://camel.465427.n5.nabble.com/camel-stax-use-a-custom-bean-handler-not-a-class-tp5732395p5732409.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-stax use a custom bean handler not a class
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi
created https://issues.apache.org/jira/browse/CAMEL-6356
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*
2013/5/13 timactive <rd...@timactive.com>
> Thank Claus.
> Indeed, the code source camel-stax say :
> In processor
> ContentHandler handler = contentHandlerClass.newInstance();
> In Component
> processor.setContentHandler(getCamelContext().getClassResolver(),
> remaining);
>
> So it is not possible actually.
>
> I am currently discussing with Romain Manni-Bucau, the developer of the
> component.
> But let's say I just finished the Camel documentation, so I'm a novice. But
> I think it happen.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-stax-use-a-custom-bean-handler-not-a-class-tp5732395p5732400.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: camel-stax use a custom bean handler not a class
Posted by timactive <rd...@timactive.com>.
Thank Claus.
Indeed, the code source camel-stax say :
In processor
ContentHandler handler = contentHandlerClass.newInstance();
In Component
processor.setContentHandler(getCamelContext().getClassResolver(),
remaining);
So it is not possible actually.
I am currently discussing with Romain Manni-Bucau, the developer of the
component.
But let's say I just finished the Camel documentation, so I'm a novice. But
I think it happen.
--
View this message in context: http://camel.465427.n5.nabble.com/camel-stax-use-a-custom-bean-handler-not-a-class-tp5732395p5732400.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-stax use a custom bean handler not a class
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Not sure if its possible to refer to a bean from the registry.
Feel free to dive into the source code of camel-stax and see what
needs to be done to support your use-case.
We love contributions
http://camel.apache.org/contributing.html
So we could maybe just try to lookup a bean from the registry first,
and if not exists fallback to current behavior.
<to uri="stax:orderHandler" />
Then we ought to support both use-cases.
On Mon, May 13, 2013 at 10:47 AM, timactive <rd...@timactive.com> wrote:
> Hi,
>
> I have a generic bean handler(extend DefaultHandler), this bean need a param
> to work correctly such as
> the nodeRoot, nodeItem etc..
> I want use this bean with camel-stax but i think is not possible :
>
> <route>
> <from uri="file:/tmp/inbox"/>
> <to uri="stax:orderHandler" />
> </route>
> <bean id="orderHandler" class="com.timactive.article.ArticleHandlerMapper">
> <property name="nodeRoot" value="ORDERS"></property>
> <property name="nodeItem" value="ORDER"></property>
> </bean>
>
> In the documentation of camel-stax http://camel.apache.org/stax.html, the
> exemple propose just to pass a class handler, not a bean?
> how would someone do this kind of process?
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-stax-use-a-custom-bean-handler-not-a-class-tp5732395.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen