camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tarun Kumar <agrawal.taru...@gmail.com>
Subject Re: Dynamic Route in camel
Date Thu, 30 May 2013 08:41:51 GMT
Alternatively, .bean(obj, methodName) also works :-)
One more question related to this:

If i try .bean(className, methodName('a', 'b')) : it calls method
methodName of class className with method parameters 'a' and 'b'. However,
if i want value of method variables to come from class variables, how can i
do that?

what i mean is :
class abc extends RouteBuilder {
  private string str1 = 'a';
  private string str2 = 'b';
.....
.....
to().bean(className, methodName(str1, str2)).end();

i get str1 and str2 classes not found exception. How can i pass str1 and
str2 values as method parameters without actually hardcoding them?


On Thu, May 30, 2013 at 2:02 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> If the bean is enlisted in the registry so Camel can look it up, then
> you can call any bean you want.
>
>
> On Thu, May 30, 2013 at 8:15 AM, Tarun Kumar <agrawal.tarun23@gmail.com>
> wrote:
> > Hey Claus,
> >
> > What if i want to call non static method with object of that bean i have
> in
> > the caller class? Is there any way to do that?
>
>
>
> --
> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message