You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jmh <je...@nrb.be> on 2012/03/13 13:07:58 UTC

Bean invocation

Hello,

suppose this route : 

	from("file://{{extra.inputDir}}")
			.routeId("start")
			.*bean*(EnterpriseServiceUtils.class,"define")......



simple question to be sure : 

Is this kind of bean definition creates a singleton or Camel creates a new
instance for each exchange ?

Regards
J-M

--
View this message in context: http://camel.465427.n5.nabble.com/Bean-invocation-tp5560764p5560764.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Bean invocation

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Mar 13, 2012 at 1:07 PM, jmh <je...@nrb.be> wrote:
> Hello,
>
> suppose this route :
>
>        from("file://{{extra.inputDir}}")
>                        .routeId("start")
>                        .*bean*(EnterpriseServiceUtils.class,"define")......
>
>
>
> simple question to be sure :
>
> Is this kind of bean definition creates a singleton or Camel creates a new
> instance for each exchange ?
>

The bean is created once (eg as singleton),using a default no-args constructor.
Or Camel can invoke the method as a static method directly, if there
is no default no-args constructor.



> Regards
> J-M
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Bean-invocation-tp5560764p5560764.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/